Branch Coverage

lib/Weather/GHCN/StationTable.pm
Criterion Covered Total %
branch 295 350 84.0


line true false branch
190 1 2 if @_
191 0 0 if @_
318 3 0 unless $args{'no_header'}
320 3 6 if $elem =~ / [[:lower:]] /msux
321 0 6 if $elem =~ / \A A_ /msux
332 1 2 $return_list ? :
373 1 2 $return_list ? :
407 3 1 if (@keys and not $args{'no_header'})
421 2 2 $return_list ? :
453 4 15 unless ($Opt->report eq "detail")
479 18 1 if $includes_month
480 16 3 if $Opt->report eq "detail" or $Opt->report eq "daily"
482 18 1 if $includes_month
483 18 1 if $includes_month
484 18 1 if $includes_month
489 15 4 if $Opt->report eq "detail"
490 15 4 if $Opt->report eq "detail"
491 15 4 if $Opt->report eq "detail"
492 15 4 if $Opt->report eq "detail"
493 15 4 if $Opt->report eq "detail"
495 15 4 $return_list ? :
535 3 0 unless $args{'no_header'}
539 0 5 if $stnobj->error_count > 0
550 1 2 $return_list ? :
634 1 1 $return_list ? :
668 5 0 unless $args{'no_header'}
672 5 0 unless ($args{'no_header'})
677 1 4 $return_list ? :
719 1 0 $return_list ? :
1 14 if $self->stn_filtered_count == 0
722 3 11 unless $no_header
729 35 1783 if (not defined $kept or $kept and $stn->error_count == 0 or not $kept and $stn->error_count > 0)
737 0 14 if $ii == 0
740 11 3 $return_list ? :
763 1 0 unless ($notes_nrs->is_empty)
809 0 6 if $Opt->report eq "detail"
827 0 433 if $Opt->range and not $opt_range_nrs->contains($year)
833 431 2 if $Opt->report eq "daily" or $Opt->report eq "monthly"
834 395 38 if $Opt->report eq "daily"
836 431 2 unless ($Opt->report eq "yearly")
845 1283 19 $cnt ? :
851 4 2 $return_list ? :
883 0 38 $args{'rows_as_tsv'} ? :
887 1 2 $return_list ? :
902 2 2 $keycount ? :
956 4 11 if ($progress_callback)
962 0 15 unless ($content)
969 4 11 if ($Opt->report eq 'detail') { }
972 10 1 unless $insufficient_quality
1040 0 19 if ($stations_content =~ m[(.*?)]msux)
1045 0 19 unless open my $stn_fh, "<", \$stations_content
1050 3 16 if $_stnid_filter_href
1069 366135 1952758 if $is_stnid_filter and not $_stnid_filter_href->{$id}
1083 15856 1936902 $gsn_flag eq 'GSN' ? :
1087 1952752 6 unless ($is_stnid_filter)
1090 267680 1685072 if $Opt->country and not $country =~ /\A$opt_country/imsu
1093 333840 1351232 if $Opt->state and not $state =~ /\A$opt_state/imsu
1096 1227387 123845 if $Opt->location and not _match_location($id, $name, $Opt->location)
1098 122047 1798 if ($Opt->gps)
1101 122027 20 if $distance > $Opt->radius
1104 0 1818 if $Opt->gsn and not $gsn
1121 0 19 unless close $stn_fh
1192 9 4 if $stn->error_count
1213 1 1 $return_list ? :
1246 0 0 if $arg{'curl'}
1249 0 0 if $stn->error_count
1253 0 0 if ($arg{'curl'}) { }
1262 0 0 $return_list ? :
1308 7 15 if (defined $user_options{'profile'})
1318 22 0 if ($_opt_href->{'cachedir'}) { }
1328 6 16 if (defined $_opt_href->{'aliases'} and defined $_opt_href->{'location'})
1333 4 2 if ($stnid_string)
1377 0 8 if $Opt->report eq "detail"
1394 1491 1820 if $Opt->report eq "monthly" or $Opt->report eq "daily"
1395 395 2916 if $Opt->report eq "daily"
1404 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') { }
1513 0 784 unless exists $base_href->{$elem}
1536 262 4 unless $baseline_nrs->contains($year)
1538 4 0 if $baseline_nrs->contains($year)
1546 0 1 if ($gap_nrs->cardinality > 0)
1587 5290 136 if (defined $max and defined $min)
1609 1 15 if ($data_quality < $quality)
1623 53 0 if $timer_label
1627 0 53 unless $content
1629 0 53 unless $content
1632 53 0 if $timer_label
1650 1207 617 unless %{$stn->elems_href}
1653 0 1824 if $Opt->range and not $opt_range_nrs->subset($stn_active_nrs)
1656 0 1824 if $Opt->gps and $stn->coordinates eq $EMPTY
1659 1207 617 if $Opt->active and not $stn->active
1662 617 1207 if ($stn->active) { }
1663 548 69 if ($Opt->partial) { }
1666 545 3 if $Opt->active and $s->is_empty
1669 41 28 if $Opt->active and not $opt_active_nrs->subset($stn_active_nrs)
1674 0 1207 if $Opt->range
1714 0 15 unless open my $stn_fh, "<", \$stn_content
1730 43430 47761 unless $element =~ $_measures_obj->re
1732 12925 34836 if $Opt->fmonth and not $opt_fmonth_nrs->contains($month)
1734 266 34570 if my $need_baseline = $Opt->anomalies
1735 34836 0 if ($Opt->range)
1736 34198 638 unless $opt_range_nrs->contains($year) or $need_baseline
1743 7830 11948 if $Opt->fday and not $opt_fday_nrs->contains($day)
1760 532 11416 if $need_baseline
1764 0 11948 if ($qflag ne $EMPTY)
1772 392 11556 if $value == -9999
1776 11556 0 if ($element =~ / \A ( TMAX | TMIN | TAVG | SNOW | SNWD | PRCP ) \Z /msux)
1781 10892 664 if $value
1787 0 15 unless close $stn_fh
1797 15 0 if ($Opt->range)
1803 1 14 if ($Opt->anomalies)
1810 1 14 if ($Opt->anomalies and $insufficient_quality == 0)
1828 0 19 unless open my $inv_fh, "<", \$inv_content
1848 13779162 17023 unless exists $_station{$id}
1850 15815 1208 unless $elem =~ $_measures_obj->re
1857 1208 0 if $elem =~ $_measures_obj->re
1860 0 19 unless close $inv_fh
1873 0 4 unless defined $row_sub
1892 998 0 $Opt->range ? :
258 740 unless $Opt->range ? $opt_range_nrs->contains($year) : $TRUE
1897 0 740 if exists $row->{'QFLAGS'}
1909 2210 42 if defined $row->{$elem}
1933 4 11 if ($Opt->active)
1937 0 4 if ($gap_nrs->cardinality)
1952 15 0 if ($Opt->range)
1955 1 14 if ($gap_nrs->cardinality)
1973 131 19 if $Opt->range and $opt_range_nrs && !$opt_range_nrs->contains($yyyy) || $Opt->anomalies && !$opt_baseline_nrs->contains($yyyy)
1980 0 19 $yyyy == $this_yyyy ? :
1984 4 15 $Opt->fmonth ? :
1992 1 18 if ($month_gap_nrs->cardinality)
2006 44 184 if $Opt->fmonth and not $opt_fmonth_nrs->contains($mm)
2010 9 175 unless $day_vec
2017 87 5338 if $Opt->fday and not $opt_fday_nrs->contains($day)
2019 99 5239 if $day > $mdays
2021 5164 75 if vec($day_vec, $day - 1, 1) == 1
2025 3 172 $Opt->fday ? :
2033 17 158 unless $day_gap_nrs->is_empty
2037 6 13 unless ($gap_text =~ /\A \s* \Z/msux)
2069 1 9 unless defined $profile
2083 8 1 if (-e $profile_filespec) { }
2095 8 0 if $yaml_struct
2163 1 16 unless $kml_colors{$c}
2205 854330 373119 if ($pattern =~ / \A $STN_ID_RE \Z /msux) { }
244096 129023 elsif ($pattern =~ / \A $STN_ID_RE ( [,] $STN_ID_RE )+ \Z /msux) { }
2240 10 26 if ($tok =~ / \A $mmm_re \Z /msux)
2243 26 10 if ($tok =~ / \A ($mmm_re) \[ ($rng_list) \] \Z /msux)
2260 7 2 unless $qflags_href
2277 1 434 unless defined $x or defined $y
2278 434 2864 unless defined $x
2279 1 2863 unless defined $y
2281 2715 148 $x > $y ? :
2288 1 431 unless defined $x or defined $y
2289 431 2844 unless defined $x
2290 1 2843 unless defined $y
2292 2690 153 $x < $y ? :
2299 1 10419 unless defined $x or defined $y
2300 10419 4965 unless defined $x
2301 1 4964 unless defined $y
2310 2 15209 unless defined $y
2312 4792 10417 defined $x ? :
2319 2 9994 unless defined $x
2320 1 9993 unless defined $y
2321 1 9992 unless $y
2339 18 171 if ($month == 2)
2356 26 32 if $year % 4
2357 8 24 if $year % 100
2358 16 8 if $year % 400
2367 1 22 unless @mm
2371 1 40 if (not $mm =~ / \A \d\d? \Z /msux) { }
38 2 elsif ($mm > 0 and $mm < 13) { }
2382 2 20 wantarray ? :
2391 97 1077 if $month == 12
2409 1079 97 unless $month == 12
2419 15 4 unless $opt_performance