Branch Coverage

blib/lib/Finance/BeanCounter.pm
Criterion Covered Total %
branch 0 528 0.0


line true false branch
92 0 0 unless grep /^$Config{'host'}$/, ('localhost', '127.0.0.1', '::1/128')
95 0 0 if ($Config{'odbc'}) { }
0 0 elsif (lc $Config{'dbsystem'} eq 'postgresql') { }
0 0 elsif (lc $Config{'dbsystem'} eq 'mysql') { }
0 0 elsif (lc $Config{'dbsystem'} eq 'sqlite') { }
0 0 elsif (lc $Config{'dbsystem'} eq 'sqlite2') { }
117 0 0 unless $dbh
125 0 0 unless $dbh->disconnect
141 0 0 unless grep /beancounter/, @tables
144 0 0 unless my(@res) = $dbh->selectrow_array($sql)
148 0 0 if $Config{'debug'}
160 0 0 if (Date_IsWorkDay($today)) { }
168 0 0 if $main::datearg
170 0 0 if $main::prevdatearg
208 0 0 if ($fxupdate) { }
215 0 0 if ($commit) { }
222 0 0 if ($equityupdate) { }
229 0 0 if ($ubcfx) { }
235 0 0 if defined $hostarg
237 0 0 if (not -f $file) { }
240 0 0 unless open FILE, "<$file"
242 0 0 if /(\#|%)/
243 0 0 if /^\s*$/
244 0 0 if (/^\s*(\w+)\s*=\s*(.+)\s*$/)
251 0 0 if defined $fx
253 0 0 if defined $dbname
254 0 0 if defined $dbsystem
255 0 0 if defined $dbsystem and lc $dbsystem eq 'odbc'
258 0 0 if defined $hostarg and $hostarg ne 'localhost'
262 0 0 if (defined $extrafx)
263 0 0 if (not $command =~ /^(update|dailyjob)$/) { }
266 0 0 if defined $extrafx
270 0 0 if (defined $updatedate)
271 0 0 if (not $command =~ /^(update|dailyjob)$/) { }
274 0 0 unless ParseDate($updatedate)
280 0 0 if $Config{'debug'}
292 0 0 if defined $res and $res =~ /(name|value|currency|cost|owner)/i and not $res =~ /(symbol|shares|exchange|day)/i
297 0 0 if $Config{'debug'}
315 0 0 if (defined $Config{'proxy'})
318 0 0 if (defined $Config{'firewall'} and $Config{'firewall'} ne '' and $Config{'firewall'} =~ /.*:.*/)
325 0 0 if (defined $Config{'timeout'})
326 0 0 if $Config{'timeout'}
335 0 0 if $Config{'debug'}
360 0 0 if $Config{'debug'}
365 0 0 if defined $PROXY
366 0 0 if defined $TIMEOUT
370 0 0 if $_ =~ /(PACIFIC|Prof\. Werner Antweiler)/
371 0 0 if $Config{'debug'}
376 0 0 if $Config{'debug'}
400 0 0 if $Config{'debug'}
425 0 0 if $Config{'debug'}
430 0 0 if defined $PROXY
431 0 0 if defined $TIMEOUT
436 0 0 if ($state == 0)
437 0 0 if ($_ =~ /
/) 
443 0 0 if ($state == 1)
444 0 0 if $_ =~ m[]
447 0 0 unless $state == 1
457 0 0 if $Config{'debug'}
496 0 0 if $Config{'proxy'}
504 0 0 if ($res->is_success) { }
519 0 0 if defined $res
520 0 0 if $Config{'debug'}
539 0 0 if defined $res
543 0 0 if $Config{'debug'}
555 0 0 if $Config{'debug'}
559 0 0 unless (defined $sth)
565 0 0 if $Config{'odbc'}
592 0 0 if (defined $res)
607 0 0 if defined $res
613 0 0 if $Config{'debug'}
619 0 0 unless (defined $sth)
625 0 0 if $Config{'debug'}
644 0 0 if $Config{'debug'}
645 0 0 if $Config{'debug'}
646 0 0 if $Config{'debug'}
663 0 0 if $Config{'debug'}
669 0 0 if $fxval eq $Config{'currency'}
670 0 0 unless (defined $sth)
676 0 0 if $Config{'odbc'}
683 0 0 if $Config{'debug'}
688 0 0 if ($fxval eq $Config{'currency'}) { }
692 0 0 unless (defined $sth)
696 0 0 unless my($val, $prevval) = $sth->fetchrow_array
701 0 0 if (Date_Cmp(ParseDate($fxdates{$fxval}), ParseDate($date)) != 0)
702 0 0 if $Config{'verbose'}
726 0 0 if (defined $Config{'proxy'})
729 0 0 if (defined $Config{'firewall'} and $Config{'firewall'} ne '' and $Config{'firewall'} =~ /.*:.*/)
736 0 0 if (defined $Config{'timeout'})
737 0 0 if $Config{'timeout'}
743 0 0 if (scalar @symbols >= 100) { }
778 0 0 if (defined $res)
793 0 0 if defined $res
798 0 0 if $Config{'debug'}
825 0 0 if $Config{'debug'}
830 0 0 if (defined $$ra[3])
832 0 0 if Date_Cmp($prevdate, $$ra[3]) < 0
867 0 0 if (defined $res)
882 0 0 if defined $res
887 0 0 if $Config{'debug'}
903 0 0 if $Config{'debug'}
914 0 0 if $Config{'debug'}
918 0 0 if ($x->count < 100) { }
919 0 0 if $Config{'debug'}
938 0 0 if $Config{'debug'}
945 0 0 if ($res < 0) { }
0 0 elsif ($res > 0) { }
956 0 0 unless (defined $rho)
962 0 0 if $Config{'debug'}
980 0 0 if $Config{'debug'}
987 0 0 if $Config{'odbc'}
999 0 0 if defined $res
1003 0 0 if $Config{'debug'}
1009 0 0 if $Config{'debug'}
1023 0 0 if (defined $pos{$pkey} and defined $vol{$pkey})
1025 0 0 if (defined $pos{$vkey} and defined $vol{$vkey} and defined $cor{$vkey}{$pkey})
1043 0 0 if (defined $pos{$pkey} and defined $vol{$pkey})
1045 0 0 if (defined $pos{$vkey} and defined $vol{$vkey} and defined $cor{$vkey}{$pkey})
1071 0 0 if $Config{'debug'}
1081 0 0 if $Config{'debug'}
1085 0 0 if $Config{'verbose'}
1087 0 0 if ($hash{$key}{'date'} eq 'N/A')
1088 0 0 if $Config{'debug'}
1092 0 0 if (&ExistsDailyData($dbh, %{$hash{$key};})) { }
1095 0 0 if ($hash{$key}{$col} =~ m[^\s*N/A\s*$]) { }
1101 0 0 if ($Config{'commit'})
1102 0 0 unless (defined $updSth)
1103 0 0 unless $updSth = $dbh->prepare($updStmt)
1105 0 0 unless $updSth->execute(@vals) and $updSth->finish
1114 0 0 if ($hash{$key}{$col} =~ m[^\s*N/A\s*$]) { }
1120 0 0 if ($Config{'commit'})
1121 0 0 unless (defined $insSth)
1122 0 0 unless $insSth = $dbh->prepare($insStmt)
1124 0 0 unless $insSth->execute(@vals) and $insSth->finish
1131 0 0 if $Config{'commit'}
1138 0 0 if ($key eq '')
1139 0 0 if $Config{'debug'}
1143 0 0 if $Config{'debug'}
1144 0 0 if (ExistsFXDailyData($dbh, $fx, %{$hash{$key};})) { }
1157 0 0 if $Config{'debug'}
1158 0 0 if $Config{'debug'}
1163 0 0 if ($Config{'commit'})
1164 0 0 unless $dbh->do($stmt, undef, $hash{$key}{'previous_close'}, $hash{$key}{'day_open'}, $hash{$key}{'day_low'}, $hash{$key}{'day_high'}, $hash{$key}{'day_close'}, $hash{$key}{'day_change'}, $fx, $hash{$key}{'date'})
1198 0 0 if $Config{'debug'}
1199 0 0 if $Config{'debug'}
1205 0 0 if ($Config{'commit'})
1207 0 0 unless $sth->execute($fx, $hash{$key}{'date'}, $hash{$key}{'previous_close'}, $hash{$key}{'day_open'}, $hash{$key}{'day_low'}, $hash{$key}{'day_high'}, $hash{$key}{'day_close'}, $hash{$key}{'day_change'})
1235 0 0 if ($Config{'commit'})
1259 0 0 if $col eq 'symbol' or $col eq 'date'
1269 0 0 if $Config{'debug'}
1270 0 0 if $Config{'debug'}
1273 0 0 unless defined $line
1278 0 0 if (defined $data{'date'})
1281 0 0 if (not defined $data{'day_close'}) { }
0 0 elsif (defined $data{'adjclose'} and $data{'adjclose'} != $data{'day_close'} and $data{'day_close'} != 0) { }
1295 0 0 if (&ExistsDailyData($dbh, %data)) { }
1298 0 0 if $col eq 'symbol' or $col eq 'date'
1299 0 0 unless defined $data{$col}
1303 0 0 unless (defined $updSth)
1304 0 0 unless $updSth = $dbh->prepare($updStmt)
1306 0 0 unless $updSth->execute(@colVals)
1312 0 0 unless defined $data{$col}
1315 0 0 unless (defined $insSth)
1316 0 0 unless $insSth = $dbh->prepare($insStmt)
1318 0 0 unless $insSth->execute(@colVals)
1323 0 0 if $Config{'commit'}
1324 0 0 if $Config{'verbose'}
1337 0 0 if /^<\!-- .*-->/
1339 0 0 if ($checked == 0 and /Date(,Open,High,Low)?,Close(,Volume)?/) { }
0 0 elsif ($checked) { }
1341 0 0 if $Config{'verbose'}
1345 0 0 if ($checked eq 5 or $checked eq 6) { }
1359 0 0 if (Date_Cmp($date, $cut) >= 0)
1367 0 0 if (ExistsFXDailyData($dbh, $fx, %data)) { }
1370 0 0 if defined $data{'day_open'}
1371 0 0 if defined $data{'day_low'}
1372 0 0 if defined $data{'day_high'}
1378 0 0 if defined $data{'day_open'}
1379 0 0 if defined $data{'day_high'}
1380 0 0 if defined $data{'day_low'}
1384 0 0 if defined $data{'day_open'}
1385 0 0 if defined $data{'day_high'}
1386 0 0 if defined $data{'day_low'}
1391 0 0 if ($Config{'commit'})
1392 0 0 if $Config{'debug'}
1393 0 0 unless $dbh->do($cmd)
1400 0 0 if $Config{'verbose'}
1409 0 0 if $$lref[0] eq 'YYYY/MM/DD'
1413 0 0 if (ExistsFXDailyData($dbh, $fx, %data)) { }
1422 0 0 if ($Config{'commit'})
1423 0 0 if $Config{'debug'}
1424 0 0 unless $dbh->do($cmd)
1429 0 0 if ($Config{'commit'})
1444 0 0 if (ExistsFXDailyData($dbh, $fx, %data)) { }
1453 0 0 if ($Config{'commit'})
1454 0 0 if $Config{'debug'}
1455 0 0 unless $dbh->do($cmd)
1460 0 0 if ($Config{'commit'})
1470 0 0 if (ExistsInfoSymbol($dbh, %{$hash{$key};}))
1471 0 0 if $Config{'verbose'}
1491 0 0 if $Config{'debug'}
1492 0 0 if $Config{'verbose'}
1493 0 0 if ($Config{'commit'})
1494 0 0 unless $dbh->do($cmd)
1503 0 0 unless (defined $_symExistsInfoSymbolSth)
1504 0 0 unless $_symExistsInfoSymbolSth = $dbh->prepare("select symbol from stockinfo\n\t\t\t\t\t\t where symbol = ?")
1508 0 0 unless $_symExistsInfoSymbolSth->execute($hash{'symbol'})
1523 0 0 unless (defined $_symExistsDailyDataSth)
1524 0 0 unless $_symExistsDailyDataSth = $dbh->prepare("select symbol from stockprices\n\t\t\t\t\twhere symbol = ? and date = ?")
1528 0 0 unless $_symExistsDailyDataSth->execute($hash{'symbol'}, $hash{'date'})
1545 0 0 if $Config{'debug'}
1570 0 0 unless ($hash{$key}{'date'} = GetDate($$ra[3]))
1594 0 0 if ($$ra[20] =~ /(\S*)B$/) { }
0 0 elsif ($$ra[20] =~ /(\S*)T$/) { }
0 0 elsif ($$ra[20] =~ /(\S*)M$/) { }
0 0 elsif ($$ra[20] =~ /(\S*)K$/) { }
1620 0 0 if ($v =~ m[(.*) (.*)/(.*)]) { }
1632 0 0 if /^<\!-- .*-->/
1714 0 0 if ($hash{$key}{'date'} eq 'N/A')
1715 0 0 if ($hash{$key}{'symbol'} =~ /^\^X/) { }
1720 0 0 if $Config{'debug'}
1734 0 0 if $Config{'debug'}
1739 0 0 if ($hash{$key}{'date'} ne $Config{'today'})
1743 0 0 if ($age > 5)
1752 0 0 if (defined $Config{'updatedate'}) { }
1764 0 0 if ($hash{$key}{'previous_close'} ne 'N/A' and $hash{$key}{'day_close'} == $hash{$key}{'previous_close'} and $hash{$key}{'day_change'} != 0)
1774 0 0 if ($hash{$key}{'symbol'} =~ /^\^X/)
1775 0 0 if (Date_Cmp(ParseDate($hash{$key}{'date'}), ParseDate('20040226')) > 0 and not Date_Cmp(ParseDate($hash{$key}{'date'}), ParseDate('20050117')) > 0)
1778 0 0 if $Config{'debug'}
1794 0 0 if ($x > 0) { }
0 0 elsif ($x < 0) { }
1811 0 0 if defined $res
1816 0 0 if $Config{'debug'}
1819 0 0 if $Config{'verbose'}
1824 0 0 if $Config{'verbose'}
1840 0 0 if defined $res
1842 0 0 if $Config{'debug'}
1845 0 0 if $Config{'debug'}
1847 0 0 if ($Config{'extrafx'})
1852 0 0 if (scalar @symbols > 0)
1856 0 0 if $Config{'verbose'}
1872 0 0 if defined $res
1873 0 0 if $Config{'debug'}
1876 0 0 if $Config{'debug'}
1881 0 0 if exists $Config{'updatedate'}
1885 0 0 if $Config{'debug'}
1889 0 0 if $Config{'debug'}
1890 0 0 if (ExistsFXDailyData($dbh, $fx, %data)) { }
1897 0 0 if $Config{'debug'}
1898 0 0 if $Config{'debug'}
1901 0 0 if ($Config{'commit'})
1902 0 0 unless $dbh->do($stmt, undef, 1 / $$ubcfx{$fx}, $fx, $data{'date'})
1909 0 0 if $Config{'debug'}
1910 0 0 if $Config{'debug'}
1913 0 0 if ($Config{'commit'})
1915 0 0 unless $sth->execute($fx, $data{'date'}, 1 / $$ubcfx{$fx})
1920 0 0 if ($Config{'commit'})
1939 0 0 if $Config{'debug'}
1940 0 0 if $Config{'verbose'}
1941 0 0 if ($Config{'commit'})
1942 0 0 unless $dbh->do($cmd)
1950 0 0 if $Config{'debug'}
1951 0 0 if ($Config{'commit'})
1952 0 0 unless $dbh->do($cmd)