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+$/ ? :
676 0 0 if ($date =~ /^-?\d+$/) { }
683 0 0 unless $normal_date
684 0 0 if $self->target_mode eq 'intraday'
691 0 0 if ($g =~ /^(m|w)/i)
692 0 0 if ($1 eq 'm') { }
694 0 0 if $dom
698 0 0 if $dow
707 0 0 if ($g =~ /^(m|w)/i)
708 0 0 if ($1 eq 'm') { }
715 0 0 unless $dow == 6
725 0 0 unless defined $dcol
741 0 0 unless $target_mode eq 'quote' or $target_mode eq 'intraday'
744 0 0 if ($target_mode ne 'intraday') { }
746 0 0 if $self->adjuster
764 0 0 unless ref $row
766 0 0 unless defined $dcol
768 0 0 if $_ == $dcol
769 0 0 if $row->[$_] =~ /^\s*$/
770 0 0 unless ($row->[$_] =~ /^\s*\$*[\d\.,]+\s*$/)
779 0 0 unless ref $row
780 0 0 unless $symbol
782 0 0 unless my $res = $self->{'results'}{$mode}
783 0 0 unless my $mres = $res->{$symbol}
784 0 0 unless defined $dcol
785 0 0 unless $$mres{$row->[$dcol]}
792 0 0 unless $date = $self->date_standardize($date)
793 0 0 if $self->{'start_date'} and $date lt $self->{'start_date'}
794 0 0 if $self->{'end_date'} and $date gt $self->{'end_date'}
810 0 0 unless $label
814 0 0 if ($pattern)
819 0 0 $label =~ /$Default_Vol_Pat/ ? :
830 0 0 unless $label
839 0 0 unless ($self->{'label_map'})
847 0 0 unless exists $self->{'label_map'}{$_}
850 0 0 unless (wantarray)
851 0 0 if @cols > 1
859 0 0 unless ($self->{'pattern_map'})
865 0 0 unless @_
867 0 0 unless $self->{'_pat_map'}{$pattern}
873 0 0 unless $self->{'pattern_map'}
879 0 0 unless $self->{'label_map'}
888 0 0 unless my $pat = $parms{'pattern'}
891 0 0 unless (defined $label)
919 0 0 unless ($tm)
924 0 0 unless ($labels)
936 0 0 if ($parms{'labels'} or not $tm->{$parse_mode})
940 0 0 if $parms{'labels'}
949 0 0 if (@_)
952 0 0 unless $self->{'parse_mode'}
957 0 0 if (@_)
960 0 0 unless $self->{'target_mode'}
965 0 0 if (@_)
968 0 0 unless $self->{'granularity'}
973 0 0 if @_
974 0 0 unless $self->{'lineup'}
984 0 0 unless $self->can($method)
1009 0 0 if (ref $data) { }
1020 0 0 if $self->{'debug'} > 2
1021 0 0 unless my $te = $class->new(%te_parms)
1025 0 0 $ts ? :
1035 0 0 unless defined $data
1036 0 0 ref $data ? :
1038 0 0 if ($csv_lines[0] =~ s/^\xEF\xBB\xBF//)
1045 0 0 if not @csv_lines or $csv_lines[0] =~ /(no data)|error/i
1048 0 0 if $csv_lines[0] =~ /date/i or $csv_lines[0] =~ /\d+$/
1049 0 0 if $self->{'verbose'}
1053 0 0 $first_line =~ /date\s*(\S)/i ? :
1054 0 0 unless my $cp = $CSV_Class->new({'sep_char', $sep_char, 'binary', 1})
1057 0 0 if ($first_line =~ /date/i) { }
1059 0 0 unless $cp->parse($first_line)
1066 0 0 unless @pats
1070 0 0 if ($header =~ /$pat/)
1089 0 0 unless $cp->parse($line)
1101 0 0 if (@_)
1103 0 0 @_ ? :
1104 0 0 if $clear
1105 0 0 defined $start_date ? :
1113 0 0 if (@_)
1115 0 0 @_ ? :
1116 0 0 if $clear
1117 0 0 defined $end_date ? :
1125 0 0 unless @dates
1127 0 0 unless $_ = ParseDate($_)
1130 0 0 @dates > 1 ? :
1140 0 0 unless $sdate and $edate
1143 0 0 if Date_IsWorkDay($sd)
1154 0 0 if (@symbols)
1177 0 0 unless $self->{'results'}
1184 0 0 unless $self->{'sources'}{$target_mode}
1202 0 0 unless $symbol
1204 0 0 unless $self->{'sources'}{$target_mode}{$symbol}
1209 0 0 unless $target_mode
1210 0 0 unless $symbol
1212 0 0 if ($source)
1225 0 0 unless ref $self->{'lineup'} and @{$self->{'lineup'};}
1226 0 0 if $self->{'verbose'}
1228 0 0 if $@
1247 0 0 unless defined $save
1250 0 0 if ($save) { }
1254 0 0 if exists $self->{$qstr}
1273 0 0 unless $increment and $increment > 0
1274 0 0 if $start_date
1275 0 0 if $end_date
1276 0 0 if ($start_date and $start_date gt $end_date)
1282 0 0 unless $end_date
1284 0 0 if ($start_date and $low_date lt $start_date)
1288 0 0 if $low_date eq $high_date