Branch Coverage

blib/lib/Finance/QuoteHist/Generic.pm
Criterion Covered Total %
branch 0 428 0.0


line true false branch
39 0 0 unless ($HTE_CLASS)
41 0 0 if $@
95 0 0 if ($k eq 'start_date' or $k eq 'end_date' and not $v =~ /^\s*$/) { }
0 0 elsif ($k =~ /^$AF_pat$/o) { }
0 0 elsif ($k =~ /^$HF_pat$/o) { }
0 0 elsif ($k eq 'row_filter') { }
0 0 elsif ($k =~ /^$SF_pat$/o) { }
99 0 0 if (UNIVERSAL::isa($v, 'ARRAY')) { }
0 0 elsif (ref $v) { }
110 0 0 if (UNIVERSAL::isa($v, 'HASH')) { }
118 0 0 unless UNIVERSAL::isa($v, 'CODE')
126 0 0 unless $parms{'symbols'}
133 0 0 unless $parms{'zthresh'}
134 0 0 unless $parms{'attempts'}
135 0 0 unless exists $parms{'adjusted'}
136 0 0 unless defined $parms{'has_non_adjusted'}
137 0 0 unless defined $parms{'quote_precision'}
138 0 0 unless exists $parms{'auto_proxy'}
139 0 0 unless defined $parms{'debug'}
145 0 0 if ($parms{'env_proxy'}) { }
0 0 elsif ($parms{'auto_proxy'}) { }
149 0 0 if $ENV{'http_proxy'}
153 0 0 unless ($self->granularity =~ /^d/i)
191 0 0 if ($self->{'verbose'})
192 0 0 $worthy ? :
205 0 0 @_ ? :
211 0 0 unless $request
213 0 0 unless (ref $request and $request->isa('HTTP::Request'))
221 0 0 unless $trys
225 0 0 $response->is_error ? :
0 0 if $self->{'debug'}
230 0 0 unless $response->is_success
232 0 0 if $self->{'verbose'}
253 0 0 @_ ? :
261 0 0 if (@r) { }
268 0 0 unless @not_seen
285 0 0 unless ($target_worthy)
296 0 0 unless UNIVERSAL::isa($urlmaker, 'CODE')
299 0 0 if ($empty_fetch{$s})
302 0 0 if $self->{'verbose'}
306 0 0 if ($self->{'verbose'})
308 0 0 if UNIVERSAL::isa($url, 'HTTP::Request')
314 0 0 $target_mode eq 'quote' ? :
319 0 0 if $self->{'verbose'} and $trys != $initial_trys
320 0 0 unless ($data = $self->{'url_cache'}{$url})
322 0 0 if (my $pre_parser = $self->pre_parser)
331 0 0 if ($data and $data eq $last_data) { }
333 0 0 if $self->{'verbose'}
337 0 0 defined $data ? :
340 0 0 if $so_far_so_good and not @$rows
345 0 0 if ($target_mode ne 'quote' or $target_mode ne 'intraday')
352 0 0 if (not $self->{'_lwp_success'} && $data) { }
0 0 elsif ($self->{'_lwp_success'} and not @$rows) { }
374 0 0 if (%extractors)
381 0 0 if ($erow = &$em($row))
383 0 0 if $self->{'verbose'}
389 0 0 unless $erow
391 0 0 if ($self->{'verbose'} and $ecount)
398 0 0 if ($extractions{$target_mode})
402 0 0 if $self->{'verbose'}
405 0 0 if (@$rows)
408 0 0 if ($target_mode eq 'split')
409 0 0 if (@{$rows->[0];} == 2)
411 0 0 if ($_->[-1] =~ /(split\s+)?(\d+)\D+(\d+)/is)
427 0 0 if $mode eq $target_mode
436 0 0 if ($target_mode eq 'quote' or $target_mode eq 'intraday')
440 0 0 if ($self->{'verbose'})
441 0 0 if ($count == @$rows) { }
451 0 0 if ($target_mode eq 'quote')
463 0 0 if (defined $q and $q =~ /\d+/) { }
466 0 0 $hcount ? :
467 0 0 if (not $trys or $pct >= $self->{'zthresh'}) { }
468 0 0 unless $saw_good_rows{$s}
480 0 0 if @$rows and $self->{'quote_precision'}
483 0 0 unless $ecount or @$rows
484 0 0 if @$rows
494 0 0 if (%empty_fetch)
499 0 0 if $self->{'verbose'} and $target_worthy
502 0 0 unless $champion and $champion->target_worthy('target_mode', $target_mode)
504 0 0 if $self->{'verbose'}
518 0 0 if (@bad_symbols and not $self->{'quiet'})
520 0 0 if ($target_mode ne 'quote')
523 0 0 if ($self->{'_lwp_status'})
534 0 0 if ($self->{'verbose'})
540 0 0 wantarray ? :
562 0 0 unless @symbols
582 0 0 unless $self->{'empty_fetches'}
590 0 0 wantarray ? :
0 0 unless $rows
592 0 0 if $self->{'verbose'}
599 0 0 if $row_filter
602 0 0 unless defined $_
611 0 0 if $target_mode eq 'intraday'
615 0 0 if ($target_mode eq 'intraday')
620 0 0 unless ($date)
621 0 0 if $self->{'verbose'}
624 0 0 unless $self->date_in_range($date)
630 0 0 if $self->{'verbose'} and @date_rows != $rc
632 0 0 wantarray ? :
644 0 0 unless $self->{'adjusted'}
646 0 0 if /adj/i
651 0 0 +(shift())->{'adjusted'} ? :
658 0 0 unless defined $dcol
667 0 0 unless $date
669 0 0 if ($self->granularity =~ /^m/ and $date =~ m[^\s*(\D+)[-/]+(\d{2,})\s*$]) { }
671 0 0 if length $y == 2
672 0 0 $m =~ /^\d+$/ ? :
675 0 0 if ($date =~ /^\d{10}$/) { }
682 0 0 unless $normal_date
683 0 0 if $self->target_mode eq 'intraday'
690 0 0 if ($g =~ /^(m|w)/i)
691 0 0 if ($1 eq 'm') { }
693 0 0 if $dom
697 0 0 if $dow
706 0 0 if ($g =~ /^(m|w)/i)
707 0 0 if ($1 eq 'm') { }
714 0 0 unless $dow == 6
724 0 0 unless defined $dcol
740 0 0 unless $target_mode eq 'quote' or $target_mode eq 'intraday'
743 0 0 if ($target_mode ne 'intraday') { }
745 0 0 if $self->adjuster
763 0 0 unless ref $row
765 0 0 unless defined $dcol
767 0 0 if $_ == $dcol
768 0 0 if $row->[$_] =~ /^\s*$/
769 0 0 unless ($row->[$_] =~ /^\s*\$*[\d\.,]+\s*$/)
778 0 0 unless ref $row
779 0 0 unless $symbol
781 0 0 unless my $res = $self->{'results'}{$mode}
782 0 0 unless my $mres = $res->{$symbol}
783 0 0 unless defined $dcol
784 0 0 unless $$mres{$row->[$dcol]}
791 0 0 unless $date = $self->date_standardize($date)
792 0 0 if $self->{'start_date'} and $date lt $self->{'start_date'}
793 0 0 if $self->{'end_date'} and $date gt $self->{'end_date'}
809 0 0 unless $label
813 0 0 if ($pattern)
818 0 0 $label =~ /$Default_Vol_Pat/ ? :
829 0 0 unless $label
838 0 0 unless ($self->{'label_map'})
846 0 0 unless exists $self->{'label_map'}{$_}
849 0 0 unless (wantarray)
850 0 0 if @cols > 1
858 0 0 unless ($self->{'pattern_map'})
864 0 0 unless @_
866 0 0 unless $self->{'_pat_map'}{$pattern}
872 0 0 unless $self->{'pattern_map'}
878 0 0 unless $self->{'label_map'}
887 0 0 unless my $pat = $parms{'pattern'}
890 0 0 unless (defined $label)
918 0 0 unless ($tm)
923 0 0 unless ($labels)
935 0 0 if ($parms{'labels'} or not $tm->{$parse_mode})
939 0 0 if $parms{'labels'}
948 0 0 if (@_)
951 0 0 unless $self->{'parse_mode'}
956 0 0 if (@_)
959 0 0 unless $self->{'target_mode'}
964 0 0 if (@_)
967 0 0 unless $self->{'granularity'}
972 0 0 if @_
973 0 0 unless $self->{'lineup'}
983 0 0 unless $self->can($method)
1008 0 0 if (ref $data) { }
1019 0 0 if $self->{'debug'} > 2
1020 0 0 unless my $te = $class->new(%te_parms)
1024 0 0 $ts ? :
1034 0 0 unless defined $data
1035 0 0 ref $data ? :
1037 0 0 if ($csv_lines[0] =~ s/^\xEF\xBB\xBF//)
1044 0 0 if not @csv_lines or $csv_lines[0] =~ /(no data)|error/i
1047 0 0 if $csv_lines[0] =~ /date/i or $csv_lines[0] =~ /\d+$/
1048 0 0 if $self->{'verbose'}
1052 0 0 $first_line =~ /date\s*(\S)/i ? :
1053 0 0 unless my $cp = $CSV_Class->new({'sep_char', $sep_char, 'binary', 1})
1056 0 0 if ($first_line =~ /date/i) { }
1058 0 0 unless $cp->parse($first_line)
1065 0 0 unless @pats
1069 0 0 if ($header =~ /$pat/)
1088 0 0 unless $cp->parse($line)
1100 0 0 if (@_)
1102 0 0 @_ ? :
1103 0 0 if $clear
1104 0 0 defined $start_date ? :
1112 0 0 if (@_)
1114 0 0 @_ ? :
1115 0 0 if $clear
1116 0 0 defined $end_date ? :
1124 0 0 unless @dates
1126 0 0 unless $_ = ParseDate($_)
1129 0 0 @dates > 1 ? :
1139 0 0 unless $sdate and $edate
1142 0 0 if Date_IsWorkDay($sd)
1153 0 0 if (@symbols)
1176 0 0 unless $self->{'results'}
1183 0 0 unless $self->{'sources'}{$target_mode}
1201 0 0 unless $symbol
1203 0 0 unless $self->{'sources'}{$target_mode}{$symbol}
1208 0 0 unless $target_mode
1209 0 0 unless $symbol
1211 0 0 if ($source)
1224 0 0 unless ref $self->{'lineup'} and @{$self->{'lineup'};}
1225 0 0 if $self->{'verbose'}
1227 0 0 if $@
1246 0 0 unless defined $save
1249 0 0 if ($save) { }
1253 0 0 if exists $self->{$qstr}
1272 0 0 unless $increment and $increment > 0
1273 0 0 if $start_date
1274 0 0 if $end_date
1275 0 0 if ($start_date and $start_date gt $end_date)
1281 0 0 unless $end_date
1283 0 0 if ($start_date and $low_date lt $start_date)
1287 0 0 if $low_date eq $high_date