Branch Coverage

blib/lib/Finance/StockAccount.pm
Criterion Covered Total %
branch 72 112 64.2


line true false branch
27 1 0 if ($options and exists $$options{'allowZeroPrice'} and $$options{'allowZeroPrice'})
98 281 0 if (defined $assertion) { }
99 281 0 if ($assertion == 1 or $assertion == 0) { }
100 262 19 if ($assertion) { }
123 1 2 if (defined $allowZeroPrice) { }
124 0 1 $allowZeroPrice ? :
134 907 42 if (exists $$self{'sets'}{$hashKey}) { }
144 3 460 if ($$self{'skipStocks'}{$hashKey}) { }
460 0 elsif (exists $$self{'sets'}{$hashKey}) { }
149 431 29 if ($set->stale)
152 189 271 if ($set->realizationCount > 0) { }
169 19 7 if $set
176 257 0 if (ref $at and ref $at eq 'Finance::StockAccount::AccountTransaction') { }
180 215 42 if ($set) { }
188 257 0 if $status
199 1 0 if (ref $accountTransactions and ref $accountTransactions eq 'ARRAY') { }
202 1 0 if $self->addToSet($at)
204 1 0 if $added
216 1 24 if (not exists $$init{'tm'} || exists $$init{'dateString'}) { }
1 23 elsif (not exists $$init{'stock'} || exists $$init{'symbol'}) { }
1 22 elsif (not exists $$init{'action'} && grep({$_ eq $$init{'action'};} 'buy', 'sell', 'short', 'cover')) { }
1 21 elsif (not exists $$init{'quantity'} && $$init{'quantity'} =~ /[0-9]/ && $$init{'quantity'} > 0) { }
1 20 elsif (not exists $$init{'price'} && $$init{'price'} =~ /[0-9]/) { }
2 18 elsif ($$init{'price'} <= 0 and not $$self{'allowZeroPrice'}) { }
241 0 0 if (exists $$init{'stock'} and exists $$init{'symbol'} || exists $$init{'exchange'})
243 0 0 if exists $$init{'symbol'}
244 0 0 if exists $$init{'exchange'}
247 18 0 if ($at) { }
260 3 2 if (scalar @skipStocks) { }
274 1 0 if (scalar keys %{$$self{'skipStocks'};})
286 327 0 if ($set)
302 291 732 if $total > $max
305 0 28 if (wantarray) { }
324 72 27 if ($set) { }
325 0 72 if ($set->stale)
329 0 72 unless $set->success
345 0 72 unless $setStart
346 15 57 if (not defined $startDate) { }
12 45 elsif ($setStart < $startDate) { }
353 15 57 if (not $endDate) { }
10 47 elsif ($setEnd > $endDate) { }
364 3 24 if ($$self{'skipStocks'}{$hashKey})
370 15 4 if ($setCount > 0) { }
371 15 0 if ($totalOutlays) { }
384 0 15 unless ($secondsInAccount)
412 19 33 if ($$self{'stats'}{'stale'} or $self->staleSets) { }
447 0 0 if ($inputKey) { }
455 0 0 if ($set)
471 98 240 if ($set)
484 13 0 if ($setCount > 0 and $totalOutlays) { }
612 1 0 if ($$stats{'annualStatsStale'}) { }
623 1 0 if ($$stats{'quarterlyStatsStale'}) { }
634 0 0 if ($$stats{'monthlyStatsStale'}) { }
655 0 0 if ($verbose)
663 0 0 if ($verbose)
670 0 0 if ($verbose)