OpenSky/Response/FlightTrack.pm

filter: Statementstmt 100% 31 / 31 Branchbran 50.0% 5 / 10 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 5 / 5 Podpod 0.0% 0 / 1 totaltotal 87.2% 41 / 47 CC 7 SCAR 9.9
CC
7
Cov
88%
_empty_response
3.1
_create_response_objects
3.0
BUILD
3.0
CRAP 2.7
« OpenSky/Utils/Iterator.pm ↑ Summary OpenSky/Response/Flights.pm »
1 package WebService::OpenSky::Response::FlightTrack;
2  
3 # ABSTRACT: A class representing a flight track from the OpenSky Network API
4 8 ▶use WebService::OpenSky::Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 8 ▶use WebService::OpenSky::Core::Waypoint;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 8 extends 'WebService::OpenSky::Response';
7  
8 8 our $VERSION = '0.5';
9  
10 8 my @ATTRS = qw(
11 icao24
12 callsign
13 startTime
14 endTime
15 path
16 );
17  
18 # XXX ugly, but this is part of an experimental API endpoint from OpenSky
19 8 param [@ATTRS] => ( is => 'rw', required => 0 );
20  
21 2 ▶method BUILD(@args) {
Subroutine BUILD: called CC=3 SCAR=11.0
Pod undocumented
Branch: 1 branch
BranchTrueFalseTotal
@_ < 1 and Function::Parameters::_croak('Too few arguments for method BUILD (expected 1, got ' . @_ . ')') 0 2 2
22 2 foreach my $attr (@ATTRS) {
23 10 $self->$attr( $self->raw_response->{$attr} );
24 }
25 8 }
26  
27 2 ▶method _create_response_objects() {
Subroutine _create_response_objects: called CC=3 SCAR=11.1
Branch: 2 branches
BranchTrueFalseTotal
@_ < 1 and Function::Parameters::_croak('Too few arguments for method _create_response_objects (expected 1, got ' . @_ . ')') 0 2 2
@_ > 1 and Function::Parameters::_croak('Too many arguments for method _create_response_objects (expected 1, got ' . @_ . ')') 0 2 2
28 2 my @path = map { WebService::OpenSky::Core::Waypoint->new($_) } $self->path->@*;
29 2 $self->path( \@path );
30 2 return \@path;
31 8 }
32  
33 1 ▶method _empty_response() {
Subroutine _empty_response: called CC=3 SCAR=11.3
Branch: 2 branches
BranchTrueFalseTotal
@_ < 1 and Function::Parameters::_croak('Too few arguments for method _empty_response (expected 1, got ' . @_ . ')') 0 1 1
@_ > 1 and Function::Parameters::_croak('Too many arguments for method _empty_response (expected 1, got ' . @_ . ')') 0 1 1
34 1 return { path => [] };
35 }
36  
37 __END__
« OpenSky/Utils/Iterator.pm ↑ Summary OpenSky/Response/Flights.pm »