Branch Coverage

blib/lib/Weather/API/Base.pm
Criterion Covered Total %
branch 75 76 98.6


line true false branch
233 5 1 if $package eq "main"
244 1 5 if $args{'ua'}
249 1 5 if $self->{'scheme'} ne "http" and $self->{'scheme'} ne "https"
266 2 2 $gm ? :
267 2 2 $gm ? :
278 3 1 $7 || $gm ? :
4 1 if $date =~ /(\d{4})-(\d{2})-(\d{2})(?:[ _Tt](\d{2}):(\d{2}):(\d{2})([Zz])?)?/
291 1 4 unless $month
298 1 3 if $pad and length $num < 2
305 1 1 unless $num and $num > 0 and $num < 13
314 2 3 unless defined $args->{'lat'} and abs $args->{'lat'} <= 90
317 2 1 unless defined $args->{'lon'} and abs $args->{'lon'} <= 180
324 5 4 $wantarr ? :
326 1 8 if $self->{'curl'}
328 5 3 if ($resp->is_success) { }
331 1 2 if ($self->{'error'} and $self->{'error'} eq 'die') { }
334 1 1 $wantarr ? :
342 1 2 unless $url =~ /^https?:/
344 1 2 if $self->{'debug'}
346 1 2 unless $self->{'ua'}
363 2 4 unless $format
365 1 3 if ($format eq 'json') { }
2 1 elsif ($format eq 'xml') { }
377 1 6 unless $ref
378 1 5 unless ref $ref
379 4 1 if ref $ref eq "HASH"
406 0 110 unless $units{$b} cmp $units{$a}
407 1 1 unless $conv
408 14 4 $units{$_}[1] && $units{$_}[1] ne $_ ? :
415 1 18 unless defined $val
418 1 34 unless $units{$_}
422 1 16 unless $units{$from}[1] eq $units{$to}[1]
427 3 13 ref $units{$from}[0] ? :
429 5 11 if $units{$from}[1] eq $to
434 3 8 ref $units{$to}[0] ? :
439 1 1 shift() ? :
448 1 1 if $rev
456 1 1 if $rev