EFA/Stop.pm

filter: Statementstmt 68.5% 24 / 35 Branchbran 40.0% 4 / 10 Conditioncond 33.3% 13 / 39 MC/DCmcdc 0.0% 0 / 20 Subroutinesub 83.3% 5 / 6 Podpod 100% 2 / 2 totaltotal 42.8% 48 / 112 CC 20 SCAR 40.1
CC
20
Cov
49%
new
74.1
TO_JSON
12.0
BEGIN
1.0
CRAP 55.0
« EFA/Trip.pm ↑ Summary EFA/Info.pm »
1 package Travel::Status::DE::EFA::Stop;
2  
3 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 2 ▶use 5.010;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 2 ▶use parent 'Class::Accessor';
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 2 our $VERSION = '3.22';
10  
11 2 Travel::Status::DE::EFA::Stop->mk_ro_accessors(
12 qw(sched_arr rt_arr arr arr_delay
13 sched_dep rt_dep dep dep_delay
14 occupancy delay distance_m is_cancelled
15 place name full_name id_num id_code latlon
16 platform niveau)
17 );
18  
19 6 ▶sub new {
Subroutine new: called CC=18 SCAR=43.1
Pod documented
20 6 my ( $obj, %conf ) = @_;
21  
22 6 my $ref = \%conf;
23  
24 6 ▶ if ( $ref->{sched_arr} and $ref->{arr_delay} and not $ref->{rt_arr} ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($ref->{"sched_arr"} and $ref->{"arr_delay"} and not $ref->{"rt_arr"}) 0 6 6
Condition33%2/6
$ref->{"sched_arr"} and $ref->{"arr_delay"} and not $ref->{"rt_arr"}
!ll&&!rl&&r
600
$ref->{"sched_arr"} and $ref->{"arr_delay"}
!ll&&!rl&&r
600
MC/DC0%0/3
$ref->{"sched_arr"} and $ref->{"arr_delay"} and not $ref->{"rt_arr"}
$ref->{"sched_arr"} $ref->{"arr_delay"} not $ref->{"rt_arr"}
Truth table25%1/4
A and B and not(C)
A= $ref->{"sched_arr"}B= $ref->{"arr_delay"}C= not $ref->{"rt_arr"}
ABCresult
0XX0
10X0
1100
1111
25 $ref->{rt_arr}
26 0 = $ref->{sched_arr}->clone->add( minutes => $ref->{arr_delay} );
27 }
28  
29 6 ▶ if ( $ref->{sched_dep} and $ref->{dep_delay} and not $ref->{rt_dep} ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($ref->{"sched_dep"} and $ref->{"dep_delay"} and not $ref->{"rt_dep"}) 0 6 6
Condition33%2/6
$ref->{"sched_dep"} and $ref->{"dep_delay"} and not $ref->{"rt_dep"}
!ll&&!rl&&r
600
$ref->{"sched_dep"} and $ref->{"dep_delay"}
!ll&&!rl&&r
600
MC/DC0%0/3
$ref->{"sched_dep"} and $ref->{"dep_delay"} and not $ref->{"rt_dep"}
$ref->{"sched_dep"} $ref->{"dep_delay"} not $ref->{"rt_dep"}
Truth table25%1/4
A and B and not(C)
A= $ref->{"sched_dep"}B= $ref->{"dep_delay"}C= not $ref->{"rt_dep"}
ABCresult
0XX0
10X0
1100
1111
30 $ref->{rt_dep}
31 0 = $ref->{sched_dep}->clone->add( minutes => $ref->{dep_delay} );
32 }
33  
34 6 ▶ $ref->{arr} //= $ref->{rt_arr} // $ref->{sched_arr};
Condition33%2/6
$ref->{"arr"} //= $ref->{"rt_arr"} // $ref->{"sched_arr"}
l!l&&r!l&&!r
006
$ref->{"rt_arr"} // $ref->{"sched_arr"}
l!l&&r!l&&!r
006
MC/DC0%0/3
$ref->{"arr"} //= $ref->{"rt_arr"} // $ref->{"sched_arr"}
$ref->{"arr"} $ref->{"rt_arr"} $ref->{"sched_arr"}
Truth table0%0/4
A //= B // C
A= $ref->{"arr"}B= $ref->{"rt_arr"}C= $ref->{"sched_arr"}
ABCresult
1XX1
01X1
0011
0000
35 6 ▶ $ref->{dep} //= $ref->{rt_dep} // $ref->{sched_dep};
Condition33%2/6
$ref->{"dep"} //= $ref->{"rt_dep"} // $ref->{"sched_dep"}
l!l&&r!l&&!r
006
$ref->{"rt_dep"} // $ref->{"sched_dep"}
l!l&&r!l&&!r
006
MC/DC0%0/3
$ref->{"dep"} //= $ref->{"rt_dep"} // $ref->{"sched_dep"}
$ref->{"dep"} $ref->{"rt_dep"} $ref->{"sched_dep"}
Truth table0%0/4
A //= B // C
A= $ref->{"dep"}B= $ref->{"rt_dep"}C= $ref->{"sched_dep"}
ABCresult
1XX1
01X1
0011
0000
36  
37 6 ▶ if ( $ref->{rt_arr}
Branch: 1 branch
BranchTrueFalseTotal
if ($ref->{"rt_arr"} and $ref->{"sched_arr"} and not defined $ref->{"arr_delay"}) 0 6 6
Condition33%2/6
$ref->{"rt_arr"} and $ref->{"sched_arr"} and not defined $ref->{"arr_delay"}
!ll&&!rl&&r
600
$ref->{"rt_arr"} and $ref->{"sched_arr"}
!ll&&!rl&&r
600
MC/DC0%0/3
$ref->{"rt_arr"} and $ref->{"sched_arr"} and not defined $ref->{"arr_delay"}
$ref->{"rt_arr"} $ref->{"sched_arr"} not defined $ref->{"arr_delay"}
Truth table25%1/4
A and B and not(C)
A= $ref->{"rt_arr"}B= $ref->{"sched_arr"}C= not defined $ref->{"arr_delay"}
ABCresult
0XX0
10X0
1100
1111
38 and $ref->{sched_arr}
39 and not defined $ref->{arr_delay} )
40 {
41 $ref->{arr_delay}
42 = $ref->{rt_arr}->subtract_datetime( $ref->{sched_arr} )
43 0 ->in_units('minutes');
44 }
45  
46 6 ▶ if ( $ref->{rt_dep}
Branch: 1 branch
BranchTrueFalseTotal
if ($ref->{"rt_dep"} and $ref->{"sched_dep"} and not defined $ref->{"dep_delay"}) 0 6 6
Condition33%2/6
$ref->{"rt_dep"} and $ref->{"sched_dep"} and not defined $ref->{"dep_delay"}
!ll&&!rl&&r
600
$ref->{"rt_dep"} and $ref->{"sched_dep"}
!ll&&!rl&&r
600
MC/DC0%0/3
$ref->{"rt_dep"} and $ref->{"sched_dep"} and not defined $ref->{"dep_delay"}
$ref->{"rt_dep"} $ref->{"sched_dep"} not defined $ref->{"dep_delay"}
Truth table25%1/4
A and B and not(C)
A= $ref->{"rt_dep"}B= $ref->{"sched_dep"}C= not defined $ref->{"dep_delay"}
ABCresult
0XX0
10X0
1100
1111
47 and $ref->{sched_dep}
48 and not defined $ref->{dep_delay} )
49 {
50 $ref->{dep_delay}
51 = $ref->{rt_dep}->subtract_datetime( $ref->{sched_dep} )
52 0 ->in_units('minutes');
53 }
54  
55 6 ▶ $ref->{delay} = $ref->{dep_delay} // $ref->{arr_delay};
Condition33%1/3
$ref->{"dep_delay"} // $ref->{"arr_delay"}
l!l&&r!l&&!r
006
MC/DC0%0/2
$ref->{"dep_delay"} // $ref->{"arr_delay"}
$ref->{"dep_delay"} $ref->{"arr_delay"}
Truth table33%1/3
A // B
A= $ref->{"dep_delay"}B= $ref->{"arr_delay"}
ABresult
1X1
011
000
56  
57 6 return bless( $ref, $obj );
58 }
59  
60 0 ▶sub TO_JSON {
Subroutine TO_JSON: not called CC=3 SCAR=24.8
Pod documented
61 0 my ($self) = @_;
62  
63 0 my $ret = { %{$self} };
64  
65 0 for my $k (qw(sched_arr rt_arr arr sched_dep rt_dep dep)) {
66 0 ▶ if ( $ret->{$k} ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($ret->{$k}) 0 0 0
67 0 $ret->{$k} = $ret->{$k}->epoch;
68 }
69 }
70  
71 0 return $ret;
72 }
73  
74 2 1;
75  
76 __END__
« EFA/Trip.pm ↑ Summary EFA/Info.pm »