Branch Coverage

lib/Weather/GHCN/StationTable.pm
Criterion Covered Total %
branch 291 344 84.5


line true false branch
184 2 2 if @_
185 0 0 if @_
312 3 0 unless $args{'no_header'}
314 3 6 if $elem =~ / [[:lower:]] /msux
315 0 6 if $elem =~ / \A A_ /msux
326 1 2 $return_list ? :
368 1 2 $return_list ? :
402 3 1 if (@keys and not $args{'no_header'})
416 2 2 $return_list ? :
448 4 15 unless ($Opt->report eq "detail")
474 18 1 if $includes_month
475 16 3 if $Opt->report eq "detail" or $Opt->report eq "daily"
477 18 1 if $includes_month
478 18 1 if $includes_month
479 18 1 if $includes_month
484 15 4 if $Opt->report eq "detail"
485 15 4 if $Opt->report eq "detail"
486 15 4 if $Opt->report eq "detail"
487 15 4 if $Opt->report eq "detail"
488 15 4 if $Opt->report eq "detail"
490 15 4 $return_list ? :
530 3 0 unless $args{'no_header'}
534 0 5 if $stnobj->error_count > 0
547 1 2 $return_list ? :
631 1 1 $return_list ? :
665 5 0 unless $args{'no_header'}
669 5 0 unless ($args{'no_header'})
674 1 4 $return_list ? :
716 1 0 $return_list ? :
1 15 if $self->stn_filtered_count == 0
719 3 12 unless $no_header
726 35 1783 if (not defined $kept or $kept and $stn->error_count == 0 or not $kept and $stn->error_count > 0)
734 0 15 if $ii == 0
737 12 3 $return_list ? :
759 2 0 unless ($notes_nrs->is_empty)
805 0 6 if $Opt->report eq "detail"
823 0 433 if $Opt->range and not $opt_range_nrs->contains($year)
829 431 2 if $Opt->report eq "daily" or $Opt->report eq "monthly"
830 395 38 if $Opt->report eq "daily"
832 431 2 unless ($Opt->report eq "yearly")
841 1283 19 $cnt ? :
847 4 2 $return_list ? :
879 0 38 $args{'rows_as_tsv'} ? :
883 1 2 $return_list ? :
898 2 2 $keycount ? :
952 4 11 if ($progress_callback)
958 0 15 unless ($content)
965 4 11 if ($Opt->report eq 'detail') { }
968 10 1 unless $insufficient_quality
1044 0 20 if ($content =~ m[(.*?)]msux)
1049 0 20 unless open my $stn_fh, "<", \$content
1055 4 16 if $_stnid_filter_href
1073 488178 1952762 if $is_stnid_filter and not $_stnid_filter_href->{$id}
1087 15856 1936906 $gsn_flag eq 'GSN' ? :
1091 1952752 10 unless ($is_stnid_filter)
1094 267680 1685072 if $Opt->country and not $country =~ /\A$opt_country/imsu
1097 333840 1351232 if $Opt->state and not $state =~ /\A$opt_state/imsu
1100 1227387 123845 if $Opt->location and not _match_location($id, $name, $Opt->location)
1102 122047 1798 if ($Opt->gps)
1105 122027 20 if $distance > $Opt->radius
1108 0 1818 if $Opt->gsn and not $gsn
1125 0 20 unless close $stn_fh
1196 9 4 if $stn->error_count
1218 1 1 $return_list ? :
1251 0 0 if $arg{'curl'}
1254 0 0 if $stn->error_count
1258 0 0 if ($arg{'curl'}) { }
1267 0 0 $return_list ? :
1313 8 15 if ($user_options{'profile'})
1323 23 0 if ($_opt_href->{'cachedir'}) { }
1333 6 17 if (defined $_opt_href->{'aliases'} and defined $_opt_href->{'location'})
1338 4 2 if ($stnid_string)
1382 0 8 if $Opt->report eq "detail"
1399 1491 1820 if $Opt->report eq "monthly" or $Opt->report eq "daily"
1400 395 2916 if $Opt->report eq "daily"
1409 3270 6719 if ($elem eq 'TMIN') { }
3293 3426 elsif ($elem eq 'TMAX' or $elem eq 'SNWD') { }
174 3252 elsif ($elem eq 'PRCP' or $elem eq 'SNOW') { }
1518 0 784 unless exists $base_href->{$elem}
1541 262 4 unless $baseline_nrs->contains($year)
1543 4 0 if $baseline_nrs->contains($year)
1551 0 1 if ($gap_nrs->cardinality > 0)
1592 5290 136 if (defined $max and defined $min)
1614 1 15 if ($data_quality < $quality)
1628 54 0 if $timer_label
1632 0 54 unless $content
1634 0 54 unless $content
1637 54 0 if $timer_label
1655 1207 621 unless %{$stn->elems_href}
1658 0 1828 if $Opt->range and not $opt_range_nrs->subset($stn_active_nrs)
1661 0 1828 if $Opt->gps and $stn->coordinates eq $EMPTY
1664 1207 621 if $Opt->active and not $stn->active
1667 621 1207 if ($stn->active) { }
1668 548 73 if ($Opt->partial) { }
1671 545 3 if $Opt->active and $s->is_empty
1674 41 32 if $Opt->active and not $opt_active_nrs->subset($stn_active_nrs)
1679 0 1207 if $Opt->range
1695 1 18 if ($gap_nrs->cardinality)
1735 0 15 unless open my $stn_fh, "<", \$stn_content
1751 43430 47761 unless $element =~ $_measures_obj->re
1753 12925 34836 if $Opt->fmonth and not $opt_fmonth_nrs->contains($month)
1755 266 34570 if my $need_baseline = $Opt->anomalies
1756 34836 0 if ($Opt->range)
1757 34198 638 unless $opt_range_nrs->contains($year) or $need_baseline
1764 7830 11948 if $Opt->fday and not $opt_fday_nrs->contains($day)
1781 532 11416 if $need_baseline
1785 0 11948 if ($qflag ne $EMPTY)
1793 392 11556 if $value == -9999
1797 11556 0 if ($element =~ / \A ( TMAX | TMIN | TAVG | SNOW | SNWD | PRCP ) \Z /msux)
1802 10892 664 if $value
1808 0 15 unless close $stn_fh
1818 15 0 if ($Opt->range)
1824 1 14 if ($Opt->anomalies)
1831 1 14 if ($Opt->anomalies and $insufficient_quality == 0)
1849 0 20 unless open my $inv_fh, "<", \$inv_content
1869 14505196 17104 unless exists $_station{$id}
1871 15888 1216 unless $elem =~ $_measures_obj->re
1878 1216 0 if $elem =~ $_measures_obj->re
1881 0 20 unless close $inv_fh
1894 0 4 unless defined $row_sub
1913 998 0 $Opt->range ? :
258 740 unless $Opt->range ? $opt_range_nrs->contains($year) : $TRUE
1918 0 740 if exists $row->{'QFLAGS'}
1930 2210 42 if defined $row->{$elem}
1954 4 11 if ($Opt->active)
1958 15 0 if ($Opt->range)
1971 131 19 if $Opt->range and $opt_range_nrs && !$opt_range_nrs->contains($yyyy) || $Opt->anomalies && !$opt_baseline_nrs->contains($yyyy)
1982 0 19 $yyyy == $this_yyyy ? :
1986 4 15 $Opt->fmonth ? :
1994 1 18 if ($month_gap_nrs->cardinality)
2008 44 184 if $Opt->fmonth and not $opt_fmonth_nrs->contains($mm)
2012 9 175 unless $day_vec
2019 87 5338 if $Opt->fday and not $opt_fday_nrs->contains($day)
2021 99 5239 if $day > $mdays
2023 5164 75 if vec($day_vec, $day - 1, 1) == 1
2027 3 172 $Opt->fday ? :
2037 17 158 unless $day_gap_nrs->is_empty
2041 1 18 if $gap_months
2046 6 13 unless ($gap_text =~ /\A \s* \Z/msux)
2099 1 16 unless $kml_colors{$c}
2141 854330 373119 if ($pattern =~ / \A $STN_ID_RE \Z /msux) { }
244096 129023 elsif ($pattern =~ / \A $STN_ID_RE ( [,] $STN_ID_RE )+ \Z /msux) { }
2176 10 26 if ($tok =~ / \A $mmm_re \Z /msux)
2179 26 10 if ($tok =~ / \A ($mmm_re) \[ ($rng_list) \] \Z /msux)
2196 7 2 unless $qflags_href
2213 1 434 unless defined $x or defined $y
2214 434 2864 unless defined $x
2215 1 2863 unless defined $y
2217 2712 151 $x > $y ? :
2224 1 431 unless defined $x or defined $y
2225 431 2844 unless defined $x
2226 1 2843 unless defined $y
2228 2704 139 $x < $y ? :
2235 1 10419 unless defined $x or defined $y
2236 10419 4965 unless defined $x
2237 1 4964 unless defined $y
2246 2 15209 unless defined $y
2248 4792 10417 defined $x ? :
2255 2 9994 unless defined $x
2256 1 9993 unless defined $y
2257 1 9992 unless $y
2275 19 179 if ($month == 2)
2292 36 35 if $year % 4
2293 8 27 if $year % 100
2294 16 11 if $year % 400
2303 1 22 unless @mm
2307 1 40 if (not $mm =~ / \A \d\d? \Z /msux) { }
38 2 elsif ($mm > 0 and $mm < 13) { }
2318 2 20 wantarray ? :
2327 97 1077 if $month == 12
2345 1079 97 unless $month == 12
2355 15 4 unless $opt_performance