Branch Coverage

File:blib/lib/Database/BI/Calc.pm
Coverage:96.0%

line%coveragebranch
279100TFif ($ch ne "%")
286100TFlength($tok // '') ? :
100TFunless length($tok // "") and exists $_FMT_RE{$tok}
302100TFunless _fmt_has_date($tokens)
314100TF$has{'Y'} && $has{'d'} && ($has{'m'} || $has{'b'}) ? :
325100TFunless _fmt_has_date($dtokens)
337100TFunless @caps
364100TFunless $y % 4 == 0 and $y % 100 != 0
372100TF$j1 == 4 || &$leap($y) && $j1 == 3 ? :
374100TFif ($week < 1)
375100TF&$leap($year - 1) ? :
378100TFif $week > &$weeks($year, $jan1)
38850TFunless defined $epoch
392100TFunless $lt[5] + 1900 == $y and $lt[4] + 1 == $mon and $lt[3] == $day
39650TFif abs $got - $want > 7200
413100TFunless defined $value and not ref $value and length $value
416100TFunless length $s
419100TFif (defined $ymd)
423100TFunless defined $epoch
424100TFdefined $h ? :
428100TFif $s =~ /\A\d{10}\z/
429100TFif $s =~ /\A\d{13}\z/
436100TFunless defined $value and not ref $value
437100TFunless my $part = _fmt_parts($value, $compiled)
44150TFdefined $$part{'b'} ? :
100TFdefined $$part{'m'} ? :
442100TFunless defined $mon and $mon >= 1 and $mon <= 12
446100TFunless defined $epoch
447100TFdefined $$part{'H'} ? :
464100TF$mon <= 2 ? :
46550TF$y >= 0 ? :
467100TF$mon > 2 ? :
481100TFunless $delta
500100TFunless defined $interval and not ref $interval and length $interval
501100TFunless my($n, $unit) = $interval =~ /\A(\d+)(mon|dec|s|m|h|d|w|q|y|c)\z/
503100TFif $n < 1
507100TFif ($unit eq "dec" or $unit eq "c")
508100TF$unit eq 'dec' ? :
512100TF$unit eq 'h' ? :
100TF$unit eq 'm' ? :
100TF$unit eq 's' ? :
516100TFdefined $secs ? :
534100TFunless defined $pattern and not ref $pattern
53550TFlength $pattern > 40 ? :
100TFif length $pattern > $MAX_PATTERN_LEN
537100TFif ($pattern =~ /$REFUSED_PATTERN_RE/)
542100TFunless ($re)
558100TFdefined $1 ? :
55950TFif $known{$n} and not $seen{$n}++
575100TFunless defined $value and not ref $value and defined $group
578100TF$group =~ /\A[0-9]+\z/ ? :
579100TFif (defined $number) { }
580100TFif $number < 1 or $number > $$compiled{"groups"}
582100TFunless grep {$_ eq $group;} @{$$compiled{"names"};}
584100TFunless $value =~ /$$compiled{"re"}/
585100TFdefined $number ? :
586100TFunless defined $got
587100TFlength $got > $MAX_CAPTURE_LEN ? :
611100TFif (not $t and $$interval{"unit"} eq "y" and defined $value and not ref $value and $value =~ /\A\s*([0-9]{3,4})\s*\z/)
616100TFunless $t
624100TFif (defined $$interval{"secs"})
636100TFif ($unit eq "d")
637100TFif $n == 1
642100TFif ($unit eq "w")
649100TF$dow == 0 ? :
658100TFif ($unit eq "mon")
664100TFif ($unit eq "q")
707100TFif ($$self{"_columns"}{$p})
718100TFif (length $expr > $MAX_EXPR_LEN)
725100TFunless ($ok)
734100TFunless ($ok)
739100TFif ($$tokens[$pos]{"type"} ne $T_EOF)
758100TFunless defined $$self{"_code"}
760100TFunless ref $row eq "HASH"
768100TF%{$$self{'_params'};} ? :
772100TFunless $ok
795100TFif ($ch =~ /\A\s/)
798100TFif (substr($expr, $pos) =~ /\A(\d+(?:\.\d+)?(?:[eE][+-]?\d+)?)/)
805100TFif ($ch eq "\"")
807100TFif $end < 0
818100TFif ($ch eq "'")
820100TFif $end < 0
831100TFif (substr($expr, $pos) =~ /\A([a-zA-Z_][a-zA-Z0-9_]*)/)
838100TFif ($pos + 1 < $len)
840100TFif ($two eq "!=")
844100TFif ($two eq "<=")
848100TFif ($two eq ">=")
852100TFif ($two eq "==")
858100TFif ($ch eq "=")
862100TFif ($ch eq "<")
866100TFif ($ch eq ">")
872100TFif (exists $single_ops{$ch})
891100TFif $$depth_ref >= $MAX_DEPTH
898100TFunless $$tok{"type"} eq $expected
914100TFif ($type eq $T_EQ or $type eq $T_NEQ or $type eq $T_LT or $type eq $T_LE or $type eq $T_GT or $type eq $T_GE)
924100TFunless defined $lv and defined $rv
925100TFif (&looks_like_number($lv) and &looks_like_number($rv)) { }
926100TF$lv == $rv ? :
100TF$lv != $rv ? :
100TF$lv < $rv ? :
100TF$lv <= $rv ? :
100TF$lv > $rv ? :
100TF$lv >= $rv ? :
100TF$op eq $T_GT ? :
100TF$op eq $T_LE ? :
100TF$op eq $T_LT ? :
100TF$op eq $T_NEQ ? :
100TF$op eq $T_EQ ? :
93450TF$cmp == 0 ? :
50TF$cmp != 0 ? :
50TF$cmp < 0 ? :
50TF$cmp <= 0 ? :
50TF$cmp > 0 ? :
50TF$cmp >= 0 ? :
100TF$op eq $T_GT ? :
100TF$op eq $T_LE ? :
100TF$op eq $T_LT ? :
100TF$op eq $T_NEQ ? :
100TF$op eq $T_EQ ? :
962100TFif ($op eq $T_PLUS) { }
965100TFunless defined $lv and defined $rv
966100TFunless &looks_like_number($lv) and &looks_like_number($rv)
97250TFunless defined $lv and defined $rv
973100TFunless &looks_like_number($lv) and &looks_like_number($rv)
995100TFif ($op eq $T_STAR) { }
998100TFunless defined $lv and defined $rv
999100TFunless &looks_like_number($lv) and &looks_like_number($rv)
100550TFunless defined $lv and defined $rv
1006100TFunless &looks_like_number($lv) and &looks_like_number($rv)
1007100TFif $rv == 0
1022100TFif ($$tok{"type"} eq $T_MINUS)
1030100TFunless defined $v and &looks_like_number($v)
1036100TFif ($$tok{"type"} eq $T_PLUS)
1046100TFif ($$tok{"type"} eq $T_LPAREN)
1054100TFif ($$tok{"type"} eq $T_NUM)
1061100TFif ($$tok{"type"} eq $T_STR)
1068100TFif ($$tok{"type"} eq $T_IDENT)
1073100TF$$tokens[$$pos_ref]{'type'} eq $T_LPAREN ? :
1086100TFunless exists $FUNCTIONS{$lc} or $lc eq "if" or $lc eq "rx" or $TIME_CONST_FNS{$lc}
1091100TFif ($lc eq "rx")
1099100TFunless $$tok{"type"} eq $T_STR or $$tok{"type"} eq $T_NUM
1104100TFunless @const == 1 or @const == 2
1106100TFdefined $const[1] ? :
1114100TFif ($TIME_CONST_FNS{$lc})
1118100TFif ($$tokens[$$pos_ref]{"type"} eq $T_COMMA)
1122100TFunless $$tok{"type"} eq $T_STR
1128100TFif ($lc eq "epoch")
1129100TFdefined $const ? :
1132100TFdefined $compiled ? :
1135100TFdefined $t ? :
1139100TFdefined $const ? :
1140100TFdefined $const ? :
100TFunless $interval
1147100TFif ($$tokens[$$pos_ref]{"type"} ne $T_RPAREN)
1157100TFif ($lc eq "if")
1160100TF&$cond_fn($_[0]) ? :
1179100TFif $$cols{$name}
1185100TFif (lc $col eq $lc_spaced)
1214100TFunless defined $$pattern{"date"} and length $$pattern{"date"}
1219100TFif (defined $time_fmt and length $time_fmt)
1220100TFunless my $compiled = eval {         do {         _fmt_compile_pair($$pattern{"date"}, $time_fmt) } }
1222100TFunless $t
1226100TFunless my $compiled = eval {         do {         _fmt_compile($$pattern{"date"}) } }
1228100TFunless $t
1231100TF($$pattern{'as'} // '') eq 'timestamp' ? :
1241100TFunless defined _epoch_of($y + 0, $mon + 0, $day + 0, 12, 0, 0)
1262100TFunless defined $val and defined $pattern and length $val
1263100TFif ref $pattern eq "HASH"
1264100TFif ($pattern eq '%m/%d/%Y') { }
100TFelsif ($pattern eq '%d/%m/%Y') { }
100TFelsif ($pattern eq '%d-%b-%Y') { }
1265100TFunless $val =~ m[\A(\d{1,2})/(\d{1,2})/(\d{4})\z]
1268100TFunless $val =~ m[\A(\d{1,2})/(\d{1,2})/(\d{4})\z]
1271100TFunless $val =~ /\A(\d{1,2})-([A-Za-z]{3})-(\d{4})\z/
1273100TFunless defined $mon