Branch Coverage

blib/lib/GPSD/Parse.pm
Criterion Covered Total %
branch 64 82 78.0


line true false branch
21 14 0 if (not $json_ok)
35 8 18 unless ($self->_file)
58 27 0 if ($self->_file) { }
61 1 26 unless open my $fh, '<', $fname
66 0 26 unless close $fh
75 0 0 if ($data->{'class'} eq 'POLL')
82 0 26 unless defined $gps_json_data
86 0 26 unless (defined $gps_perl_data->{'tpv'}[0])
92 1 25 if defined $args{'return'} and $args{'return'} eq 'json'
101 77 1 if (defined $stat)
102 1 76 unless defined $self->{'tpv'}{$stat}
134 66 2 if (defined $sat_num)
135 1 65 unless defined $self->{'satellites'}{$sat_num}
138 65 2 if (defined $sat_num and defined $stat)
139 13 52 unless defined $self->{'satellites'}{$sat_num}{$stat}
157 32 0 if @_ > 1
178 1 27 unless (@_)
185 23 4 unless $lat =~ /[NESW]$/
186 0 4 unless $lon =~ /[NESW]$/
206 1 7 unless (@_)
212 0 7 if $lat =~ /[NESW]$/
213 0 7 if $lon =~ /[NESW]$/
215 2 5 if ($lat =~ /^-/) { }
222 5 2 if ($lon =~ /^-/) { }
239 5 21 if (not $self->_is_metric)
249 19 122 if defined $file
254 0 24 if defined $host
255 8 16 unless defined $self->{'host'}
261 9 50 if defined $metric
262 24 35 unless defined $self->{'metric'}
268 4 50 if defined $signed
269 24 30 unless defined $self->{'signed'}
274 0 24 if defined $port
275 8 16 unless defined $self->{'port'}
295 23 3 $self->_is_signed ? :
304 156 182 $sat->{'used'} ? :
312 0 26 if defined $status
318 0 8 if $self->_file
320 8 0 unless (defined $self->{'socket'})
329 8 0 unless defined $self->{'socket'}
335 0 26 if $self->_is_socket