Express/Provider/Station.pm

filter: Statementstmt 52.0% 13 / 25 Branchbran 0.0% 0 / 6 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 80.0% 4 / 5 Podpod 0.0% 0 / 1 totaltotal 40.4% 17 / 42 CC 5 SCAR 28.4
CC
5
Cov
38%
call
30.0
BEGIN
1.0
BEGIN
1.0
CRAP 17.1
« Express/Provider/Line.pm ↑ Summary Express.pm »
1 package WebService::Heartrails::Express::Provider::Station;
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 utf8;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 2 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 0 ▶sub call{
Subroutine call: not called CC=5 SCAR=34.0
Pod undocumented
8 0 my($self,$class,$arg) = @_;
9  
10 0 my $line = $arg->{line};
11 0 my $name = $arg->{name};
12  
13 0 ▶ unless(defined $line or defined $name){
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $line or defined $name) 0 0 0
Condition0%0/3
defined $line or defined $name
l!l&&r!l&&!r
000
MC/DC0%0/2
defined $line or defined $name
defined $line defined $name
Truth table0%0/3
A or B
A= defined $lineB= defined $name
ABresult
1X1
011
000
14 0 croak("line or name is either required");
15 }
16  
17 0 my $sub_url = do{
18 0 ▶ if(not defined $line){
Branch: 2 branches
BranchTrueFalseTotal
if (not defined $line) { } 0 0 0
elsif (not defined $name) { } 0 0 0
19 0 {method => 'getStations',name => $name};
20 }elsif(not defined $name){
21 0 {method => 'getStations',line => $line};
22 }else{
23 0 {method => 'getStations',line => $line ,name => $name};
24 }
25 };
26  
27 0 my $content = WebService::Heartrails::Express::Provider::Common::call($class,$sub_url);
28  
29 0 return JSON::decode_json($content)->{response}->{station};
30  
31 }
32  
33 2 1;
« Express/Provider/Line.pm ↑ Summary Express.pm »