Branch Coverage

blib/lib/Date/Calc/Object.pm
Criterion Covered Total %
branch 356 526 67.6


line true false branch
47 1 1238 if ref $_[0] ne 'ARRAY'
49 195 1043 if (ref $_[0][0]) { }
51 6 189 if (ref $_[0][0] eq 'ARRAY') { }
188 1 elsif (ref($_[0][0]) =~ /[^:]::[^:]/) { }
53 1 5 if (@{$_[0][0];} == 3) { }
73 1042 1 if (@{$_[0];} >= 1) { }
86 1 23847 if ref $_[0] ne 'ARRAY'
88 48 23799 if (ref $_[0][0]) { }
90 34 14 if (ref $_[0][0] eq 'ARRAY') { }
13 1 elsif (ref($_[0][0]) =~ /[^:]::[^:]/) { }
92 28 6 if (@{$_[0][0];} == 3) { }
112 23796 3 if (@{$_[0];} >= 3) { }
125 1 19 if ref $_[0] ne 'ARRAY'
127 12 7 if (ref $_[0][0]) { }
129 7 5 if (ref $_[0][0] eq 'ARRAY') { }
4 1 elsif (ref($_[0][0]) =~ /[^:]::[^:]/) { }
131 1 6 if (@{$_[0][0];} == 3) { }
151 4 3 if (@{$_[0];} >= 3) { }
164 1 25 if ref $_[0] ne 'ARRAY'
166 15 10 if (ref $_[0][0]) { }
168 10 5 if (ref $_[0][0] eq 'ARRAY') { }
4 1 elsif (ref($_[0][0]) =~ /[^:]::[^:]/) { }
170 1 9 if (@{$_[0][0];} == 6) { }
190 4 6 if (@{$_[0];} >= 6) { }
263 22 0 if (@_ > 1)
274 2 0 if (@_ > 1)
285 0 0 if (@_ > 1)
297 4 4 if (ref $self) { }
299 0 4 defined $$self[0][1] ? :
300 4 0 if (@_ > 0)
302 4 0 defined $_[0] ? :
308 4 0 if (@_ > 0)
321 6 7 if (ref $self) { }
323 0 6 defined $$self[0][2] ? :
324 6 0 if (@_ > 0)
326 6 0 defined $_[0] ? :
332 7 0 if (@_ > 0)
347 9 5 if (ref $self) { }
349 4 5 defined $$self[0][3] ? :
350 5 3 if (@_ > 0)
352 5 0 if (defined $_[0]) { }
355 4 1 unless ($temp =~ /^\d+$/)
357 5 0 if ($temp >= 1 and $temp <= Languages()) { }
368 3 2 if (@_ > 0)
371 1 2 unless ($temp =~ /^\d+$/)
373 3 0 if ($temp >= 1 and $temp <= Languages()) { }
380 1 13 if ($@)
396 60 1 if (defined $$self[0] and ref $$self[0] eq 'ARRAY' and defined $$self[0][0])
399 16 44 $$self[0][0] ? :
401 0 61 if ($@)
412 926 1 if (defined $$self[0] and ref $$self[0] eq 'ARRAY' and defined $$self[0][0])
415 322 604 $$self[0][0] ? :
417 0 927 if ($@)
428 0 0 if (@{$self;} == 4) { }
0 0 elsif (@{$self;} == 7) { }
431 0 0 if ($@)
442 205 313 if (@{$self;} == 7) { }
313 0 elsif (@{$self;} == 4) { }
445 0 518 if ($@)
456 1272 2 if (defined $$self[0] and ref $$self[0] eq 'ARRAY' and @{$$self[0];} > 0 and defined $$self[0][0] and not ref $$self[0][0] and $$self[0][0] == 0 || $$self[0][0] == 1 and @{$self;} == 4 || @{$self;} == 7)
464 421 851 if ($$self[0][0]) { }
466 0 421 unless defined $$self[1] and not ref $$self[1] and defined $$self[2] and not ref $$self[2] and defined $$self[3] and not ref $$self[3]
472 210 211 if (@{$self;} > 4)
474 0 210 unless defined $$self[4] and not ref $$self[4] and defined $$self[5] and not ref $$self[5] and defined $$self[6] and not ref $$self[6]
490 3 848 unless defined $$self[1] and not ref $$self[1] and defined $$self[2] and not ref $$self[2] and defined $$self[3] and not ref $$self[3] and check_date(@{$self;}[1..3])
492 314 534 if (@{$self;} > 4)
499 0 314 unless defined $$self[4] and not ref $$self[4] and defined $$self[5] and not ref $$self[5] and defined $$self[6] and not ref $$self[6] and check_time(@{$self;}[4..6])
507 0 1275 if ($@)
516 13 0 if ($self->is_valid)
518 12 1 if ($self->is_delta) { }
520 12 0 if ($self->is_long)
524 6 6 unless ($ACCURATE_MODE)
526 4 2 if ($$self[2] and $quot = int $$self[2] / 12)
531 1 5 if ($$self[2] < 0 and $$self[3] > 0 || $$self[4] > 0 || $$self[5] > 0 || $$self[6] > 0) { }
3 2 elsif ($$self[2] > 0 and $$self[3] < 0 || $$self[4] < 0 || $$self[5] < 0 || $$self[6] < 0) { }
559 1 0 if $^W
569 538 0 if (@_)
572 29 509 if (@_ == 1 and ref $_[0] eq 'ARRAY') { }
574 6 180 unless defined $list and @$list == 0 || @$list == 1 || @$list == 3 || @$list == 4 || @$list == 6 || @$list == 7
577 416 116 if (@$list == 1 or @$list == 4 or @$list == 7) { }
72 44 elsif (@$list == 3 or @$list == 6) { }
579 106 310 shift @$list ? :
599 0 18 unless $self->is_valid
614 2 0 if (@_ == 1 and ref $_[0]) { }
617 2 0 if (defined $$this[0])
619 2 0 if (ref $$this[0] eq 'ARRAY') { }
623 0 2 if ($@)
624 0 2 unless $self->is_valid
632 42 0 if (@_)
635 0 42 if (@_ == 1 and ref $_[0] eq 'ARRAY') { }
637 0 5 unless defined $list and @$list == 0 || @$list == 1 || @$list == 3 || @$list == 4 || @$list == 6 || @$list == 7
642 5 37 if (@$list == 1 or @$list == 4 or @$list == 7)
644 0 5 shift @$list ? :
646 5 37 if (@$list == 3 or @$list == 6)
651 0 42 if ($@)
652 0 42 unless $self->is_valid
660 15 0 if (@_)
663 0 15 if (@_ == 1 and ref $_[0] eq 'ARRAY') { }
665 0 1 unless defined $list and @$list == 0 || @$list == 1 || @$list == 3 || @$list == 4
670 0 15 if (@$list == 1 or @$list == 4)
672 0 0 shift @$list ? :
674 1 14 if (@$list == 3)
679 0 15 if ($@)
680 0 15 unless $self->is_valid
681 14 1 if (@{$self;} == 7) { }
689 13 0 if (@_)
692 0 13 if (@_ == 1 and ref $_[0] eq 'ARRAY') { }
694 0 0 unless defined $list and @$list == 0 || @$list == 1 || @$list == 3 || @$list == 4 || @$list == 6 || @$list == 7
699 0 13 if (@$list == 1 or @$list == 4 or @$list == 7)
701 0 0 shift @$list ? :
703 0 13 if (@$list == 3) { }
0 13 elsif (@$list == 6) { }
712 0 13 if ($@)
713 0 13 unless $self->is_valid
714 8 5 if (@{$self;} == 7) { }
723 0 0 if (ref $self) { }
740 0 0 if (ref $self) { }
757 0 0 if (ref $self) { }
778 0 1 if ($@)
784 1 0 if (ref $self) { }
805 0 1 if ($@)
811 1 0 if (ref $self) { }
828 1 0 if (ref $self) { }
830 0 1 unless $self->is_valid
831 0 1 if $self->is_delta
836 0 1 if ($@)
859 0 0 if ($@)
865 0 0 if (ref $self) { }
882 3 0 if (ref $self) { }
884 0 3 unless $self->is_valid
885 0 3 if $self->is_delta
890 0 3 if ($@)
913 0 4 if ($@)
919 3 1 if (ref $self) { }
935 0 24 if (@_ > 0)
938 0 0 if ($@)
940 0 24 unless $self->is_valid
948 0 9 if (@_ > 0)
951 0 0 if ($@)
953 0 9 unless $self->is_valid
961 1 9 if (@_ > 0)
964 0 1 if ($@)
966 0 10 unless $self->is_valid
974 0 9 if (@_ > 0)
978 0 0 if (@{$self;} == 4)
984 0 0 if (@{$self;} == 7)
989 0 0 if ($@)
991 0 9 unless $self->is_valid
992 4 5 if (@{$self;} == 7) { }
1000 0 9 if (@_ > 0)
1004 0 0 if (@{$self;} == 4)
1010 0 0 if (@{$self;} == 7)
1015 0 0 if ($@)
1017 0 9 unless $self->is_valid
1018 4 5 if (@{$self;} == 7) { }
1026 0 9 if (@_ > 0)
1030 0 0 if (@{$self;} == 4)
1036 0 0 if (@{$self;} == 7)
1041 0 0 if ($@)
1043 0 9 unless $self->is_valid
1044 4 5 if (@{$self;} == 7) { }
1070 40 0 if ($self->is_valid)
1074 32 8 unless defined $format
1075 26 14 if ($$self[0][0]) { }
1079 24 2 if (@{$self;} == 4) { }
1081 0 24 if (ref $format eq 'CODE') { }
1092 0 2 if (ref $format eq 'CODE') { }
0 2 elsif ($format == 2) { }
1107 4 4 $_ < 0 ? :
1108 1 1 $sign ? :
1114 8 6 if (@{$self;} == 4) { }
1116 0 8 if (ref $format eq 'CODE') { }
0 8 elsif ($format == 2 or $format == 1) { }
1132 0 6 if (ref $format eq 'CODE') { }
0 6 elsif ($format == 2) { }
0 6 elsif ($format == 1) { }
1154 0 40 if ($@)
1170 142 0 if ($self->is_valid)
1172 4 138 if (defined $lang and $lang ne '') { }
1174 0 4 unless $lang =~ /^\d+$/
1178 10 128 if (defined $$self[0][3]) { }
1181 1 141 unless $lang >= 1 and $lang <= Languages()
1184 40 101 if ($$self[0][0]) { }
1186 3 37 defined $$self[0][1] ? :
40 0 unless defined $format
1188 20 20 if (@{$self;} == 4) { }
1190 0 20 if (ref $format eq 'CODE') { }
0 20 elsif ($format == 4) { }
0 20 elsif ($format == 3) { }
0 20 elsif ($format == 2) { }
20 0 elsif ($format == 1) { }
1221 3 17 if (ref $format eq 'CODE') { }
0 17 elsif ($format == 4) { }
0 17 elsif ($format == 3) { }
0 17 elsif ($format == 2) { }
16 1 elsif ($format == 1) { }
1253 15 82 defined $$self[0][2] ? :
97 4 unless defined $format
1255 88 13 if (@{$self;} == 4) { }
1257 5 83 if (ref $format eq 'CODE') { }
0 83 elsif ($format == 4) { }
15 68 elsif ($format == 3) { }
1 67 elsif ($format == 2) { }
67 0 elsif ($format == 1) { }
1288 6 7 if (ref $format eq 'CODE') { }
0 7 elsif ($format == 4) { }
3 4 elsif ($format == 3) { }
0 4 elsif ($format == 2) { }
4 0 elsif ($format == 1) { }
1322 1 140 if ($@)
1338 0 451 unless $self->is_valid
1339 0 451 if ($code == 0)
1341 0 0 unless $self->is_delta
1351 368 83 if (defined $this and ref($this) =~ /[^:]::[^:]/) { }
55 28 elsif (defined $this and ref $this eq 'ARRAY') { }
28 0 elsif (defined $this and not ref $this) { }
1353 0 368 unless $this->is_valid
1357 49 6 if (@{$this;} == 3 or @{$this;} == 6) { }
1359 2 47 if ($code == 6) { }
16 31 elsif ($code == 5) { }
1376 2 53 unless $this->is_valid
1381 0 28 unless $this->is_valid
1386 242 207 if ($code == 6 or $code == 5) { }
207 0 elsif ($code <= 4 and $code >= 1) { }
1388 123 119 if ($code == 6) { }
1390 0 122 if not $val1 and $val2 and not $flag or $val1 and not $val2 and $flag
1396 2 117 if $val1 and $val2
1401 94 146 if ($len1 or $len2) { }
1403 188 52 if (defined $flag) { }
1405 2 18 unless ($val1 or $val2)
1410 6 6 if ($code == 6) { }
1412 0 6 if ($flag) { }
1437 0 207 if $val1 xor $val2
1439 204 3 if ($code >= 3) { }
1441 165 39 if ($code == 4) { }
1447 0 1107 if (($$self[$item] || 0) != ($$this[$item] || 0))
1457 3 0 if ($code == 2) { }
1467 0 3 if ($flag) { }
1527 175 9 if (@{$self;} == 7) { }
1535 120 18 if ($val1) { }
1537 40 80 if ($len1 or $len2) { }
1539 40 0 if (not $ACCURATE_MODE and $NORMALIZED_MODE) { }
1554 56 24 if (not $ACCURATE_MODE and $NORMALIZED_MODE) { }
1568 6 12 if ($len1 or $len2) { }
1570 0 6 if (not $ACCURATE_MODE and $NORMALIZED_MODE) { }
1585 6 6 if (not $ACCURATE_MODE and $NORMALIZED_MODE) { }
1596 4 2 if not defined $flag and $^W
1608 116 1 if ($val1 or $val2)
1621 122 1 if ($val1 or $val2)
1623 100 22 if ($val1 and $val2) { }
1625 46 54 if ($len1 or $len2) { }
1627 3 43 if ($ACCURATE_MODE) { }
1629 0 3 if ($flag) { }
1644 40 3 if ($NORMALIZED_MODE) { }
1646 0 40 if ($flag) { }
1661 0 3 if ($flag) { }
1678 10 44 if ($ACCURATE_MODE) { }
1680 0 10 if ($flag) { }
1693 39 5 if ($NORMALIZED_MODE) { }
1695 0 39 if ($flag) { }
1708 0 5 if ($flag) { }
1721 2 2 if not defined $flag and $^W
1727 22 0 if ($val1) { }