Branch Coverage

File:blib/lib/Weather/Meteo.pm
Coverage:74.2%

line%coveragebranch
202100TFif (not defined $class) { }
100TFelsif (&Scalar::Util::blessed($class)) { }
207100TFif (exists $params->{'ua'})
20850TFif (not defined $params->{'ua'}) { }
50TFelsif (not &Scalar::Util::blessed($params->{'ua'}) && $params->{'ua'}->can('get')) { }
224100TFif ($params->{'host'})
22550TFunless my($safe_host) = $params->{'host'} =~ /\A([A-Za-z0-9][A-Za-z0-9.\-]*(:\d{1,5})?)\z/
231100TFunless (defined $ua)
364100TFif (scalar @_ == 2 and &Scalar::Util::blessed($_[0]) and $_[0]->can('latitude')) { }
373100TFif $_[0]->can("tz") and $ENV{'TIMEZONEDB_KEY'}
384100TFif (not defined $latitude and defined $location and &Scalar::Util::blessed($location) and $location->can("latitude"))
390100TFunless (defined $latitude and defined $longitude and defined $date)
39250TFif $self->{'logger'}
403100TFunless (defined $lat_clean and defined $lon_clean)
40550TFif $self->{'logger'}
411100TFif (&Scalar::Util::blessed($date) and $date->can('strftime')) { }
100TFelsif ($date =~ /^(\d{4})-/) { }
414100TFif $1 < 1940
420100TFunless ($date =~ /^\d{4}-\d{2}-\d{2}$/)
42250TFif $self->{'logger'}
427100TFif (my $cached = $self->{'cache'}->get($cache_key))
448100TFunless defined $rc and ref $rc eq "HASH"
450100TFif ($rc->{'error'})
45550TFif $self->{'logger'}
460100TFunless defined $rc->{'hourly'}
566100TFif (scalar @_ >= 1 and &Scalar::Util::blessed($_[0]) and $_[0]->can('latitude')) { }
573100TFif defined $_[1]
5750TFif $location->can("tz") and $ENV{'TIMEZONEDB_KEY'}
5860TFif (not defined $latitude and defined $location and &Scalar::Util::blessed($location) and $location->can("latitude"))
592100TFunless (defined $latitude and defined $longitude)
59450TFif $self->{'logger'}
603100TFunless (defined $lat_clean and defined $lon_clean)
60550TFif $self->{'logger'}
611100TFif (not $days =~ /^\d+$/ or $days < 1 or $days > 16)
617100TFif (my $cached = $self->{'cache'}->get($cache_key))
63650TFunless defined $rc and ref $rc eq "HASH"
63750TFif $rc->{'error'}
63850TFunless defined $rc->{'hourly'}
756100TFif (scalar @_ >= 1 and &Scalar::Util::blessed($_[0]) and $_[0]->can('latitude')) { }
76350TFif defined $_[1]
7650TFif $location->can("tz") and $ENV{'TIMEZONEDB_KEY'}
7750TFif (not defined $latitude and defined $location and &Scalar::Util::blessed($location) and $location->can("latitude"))
781100TFunless (defined $latitude and defined $longitude)
78350TFif $self->{'logger'}
79250TFunless (defined $lat_clean and defined $lon_clean)
7940TFif $self->{'logger'}
80450TFif (defined $date and &Scalar::Util::blessed($date) and $date->can("strftime"))
808100TFif (defined $date and not $date =~ /^\d{4}-\d{2}-\d{2}$/)
818100TFif (my $cached = $self->{'cache'}->get($cache_key))
82250TF$use_forecast ? :
82350TF$use_forecast ? :
83650TFunless defined $rc and ref $rc eq "HASH" and not $rc->{'error'}
83950TFunless ref $daily eq "HASH"
84150TFref $daily->{'sunrise'} eq 'ARRAY' ? :
84250TFref $daily->{'sunset'} eq 'ARRAY' ? :
84350TFunless defined $sr and defined $ss
903100TFif (@_)
914100TFunless (defined $params->{'ua'})
91550TFif $self->{'logger'}
937100TFif (my($frac) = $result =~ /\A-\.((?>\d+))\z/) { }
100TFelsif ($result =~ /\A\./) { }
953100TFif ($elapsed < $self->{'min_interval'})
978100TFunless (defined $res and ref $res and $res->can("is_error"))
983100TFif ($res->is_error)
990100TFif ($@)
995100TFif length $err > 200