Branch Coverage

blib/lib/Exception/Base.pm
Criterion Covered Total %
branch 347 408 85.0


line true false branch
167 1 0 if (not $@) { }
183 1 0 if (not $@) { }
255 1 0 if $] >= 5.01
843 1 51 if ($name eq ':all') { }
21 30 elsif ($name =~ /^([+-]?)([a-z0-9_]+)$/) { }
855 16 14 if defined $_[0] and ref $_[0] eq 'HASH'
857 3 27 defined $$param{'version'} ? :
859 29 1 if (caller ne $name)
860 2 27 if eval { do { $name->VERSION($version) } }
869 26 1 if ($@) { }
871 3 23 unless ($@ =~ /Can\'t locate/)
884 0 24 if $name eq 'Exception::Base'
887 1 23 if ($class ne 'Exception::Base')
953 22 50 if (not defined $Class_Attributes{$class}) { }
971 46 4 if ($$attributes{$key}{'is'} eq 'rw')
1032 34 2 if (not ref $self) { }
1034 33 1 if (not ref $_[0]) { }
1036 30 3 if (scalar @_ % 2 == 0) { }
1045 2 1 unless defined $$e{$default_attribute}
1064 1 1 if ($$attrs{$key}{'is'} eq 'rw')
1069 1 2 if (ref $old_e ne $class)
1114 1 18 if (@_ > 1) { }
1125 3 16 if (ref $e and do { local $@; local $SIG{'__DIE__'}; eval { do { $e->isa('Exception::Base') } } }) { }
2 14 elsif ($e eq '') { }
1238 7 152 if (ref $that eq 'ARRAY') { }
100 52 elsif (ref $that eq 'HASH') { }
24 28 elsif (ref $that eq 'Regexp' or ref $that eq 'CODE' or not defined $that) { }
3 25 elsif (ref $that) { }
13 12 elsif ($that =~ /^[+-]?\d+$/) { }
1257 0 156 unless @args
1260 36 120 if (scalar @args % 2 == 1)
1262 0 36 if (ref $val eq 'ARRAY') { }
8 28 elsif (not defined $val) { }
0 28 elsif (not ref $val and $val =~ /^[+-]?\d+$/) { }
7 21 elsif (not $self->_string_attributes) { }
1265 0 0 if (not defined $arrval) { }
0 0 elsif (not ref $arrval and $arrval =~ /^[+-]?\d+$/) { }
0 0 elsif (not $self->_string_attributes) { }
1266 0 0 unless $self->_string_attributes
1270 0 0 if $$self{$numeric_attribute} == $arrval
1277 0 0 if (ref $arrval eq 'CODE') { }
0 0 elsif (ref $arrval eq 'Regexp') { }
1278 0 0 if &$arrval()
1281 0 0 if /$arrval/
1284 0 0 if $_ eq $arrval
1287 0 0 if $arrret
1290 0 0 unless $arrret
1293 4 4 if $self->_string_attributes
1297 0 0 if $$self{$numeric_attribute} != $val
1304 6 15 if (ref $val eq 'CODE') { }
6 9 elsif (ref $val eq 'Regexp') { }
1305 2 4 unless &$val()
1308 2 4 unless /$val/
1311 4 5 if $_ ne $val
1314 17 0 unless @args
1319 6 120 if ($key eq '-default')
1324 11 115 if ($key eq '-isa') { }
4 111 elsif ($key eq '-has') { }
38 73 elsif (ref $val eq 'ARRAY') { }
12 61 elsif (not defined $val) { }
17 44 elsif (not ref $val and $val =~ /^[+-]?\d+$/) { }
10 34 elsif (not defined $$self{$key}) { }
1325 9 2 if (ref $val eq 'ARRAY') { }
1328 0 21 unless defined $arrval
1329 5 16 if $self->isa($arrval)
1330 5 16 if $arrret
1332 4 5 unless $arrret
1335 1 1 unless $self->isa($val)
1339 2 2 if (ref $val eq 'ARRAY') { }
1342 0 5 unless defined $arrval
1343 1 4 if exists $self->ATTRS->{$arrval}
1344 1 4 if $arrret
1346 1 1 unless $arrret
1349 1 1 unless $self->ATTRS->{$val}
1355 17 60 if (not defined $arrval) { }
24 36 elsif (not defined $$self{$key}) { }
1356 9 8 unless defined $$self{$key}
1365 9 27 ref $$self{$key} eq 'ARRAY' ? :
1368 8 28 if (ref $arrval eq 'CODE') { }
12 16 elsif (ref $arrval eq 'Regexp') { }
1369 4 4 if &$arrval()
1372 4 8 if /$arrval/
1375 4 12 if $_ eq $arrval
1378 21 32 if $arrret
1380 17 21 unless $arrret
1383 6 6 if exists $$self{$key} and defined $$self{$key}
1387 6 11 if $$self{$key} != $val
1396 10 24 ref $$self{$key} eq 'ARRAY' ? :
1400 12 22 if (ref $val eq 'CODE') { }
12 10 elsif (ref $val eq 'Regexp') { }
1401 4 8 unless &$val()
1404 4 8 unless /$val/
1407 4 6 if $_ ne $val
1434 48 10 defined $$self{'verbosity'} ? :
1440 4 54 if ($message eq '')
1443 4 0 if defined $message
1447 18 40 if ($verbosity == 1) { }
20 20 elsif ($verbosity == 2) { }
16 4 elsif ($verbosity >= 3) { }
1448 4 14 if $message =~ /\n$/
1453 1 19 if $message =~ /\n$/
1485 3 6 if defined $$self{$numeric_attribute}
1486 4 2 if defined $$self{'defaults'}{$numeric_attribute}
1523 0 35 if $$self{'tid'}
1525 30 5 defined $$self{'verbosity'} ? :
1529 10 0 defined $$self{'defaults'}{'ignore_level'} ? :
25 10 defined $$self{'ignore_level'} ? :
1538 43 36 if $self->_skip_ignored_package($c{'package'})
1540 5 31 if ($ignore_level > 0)
1544 31 0 defined $c{'file'} && $c{'file'} ne '' ? :
1551 4 31 unless (@stacktrace)
1553 2 2 defined $c{'file'} && $c{'file'} ne '' ? :
1558 16 19 if ($verbosity >= 3)
1560 4 12 if ($verbosity >= 4)
1565 0 24 if $verbosity == 3 and $self->_skip_ignored_package($c{'package'})
1572 5 19 if $verbosity <= 3 and $self->_skip_ignored_package($package)
1573 19 0 defined $file && $file ne '' ? :
1580 19 16 wantarray ? :
1600 0 3 !defined($Isa_Package{$c[0]}) ? :
0 3 if !defined($Isa_Package{$c[0]}) ? $Isa_Package{$c[0]} = do { local $@; local $SIG{'__DIE__'}; eval { do { $c[0]->isa('Exception::Base') } } } : $Isa_Package{$c[0]}
1615 25 86 ref $_ eq 'ARRAY' ? :
112 24 if defined $_
1656 7 66 defined $$self{'verbosity'} ? :
1657 62 11 if ($verbosity >= 2)
1659 0 62 if defined &threads::tid
1670 3 99 !defined($Isa_Package{$c[0]}) ? :
40 62 if !defined($Isa_Package{$c[0]}) ? $Isa_Package{$c[0]} = do { local $@; local $SIG{'__DIE__'}; eval { do { $c[0]->isa('Exception::Base') } } } : $Isa_Package{$c[0]}
1675 5 126 if ref $_
1681 62 0 if $verbosity == 2 and not $self->_skip_ignored_package($stacktrace_element[0])
1694 88 97 defined $$self{'ignore_package'} ? :
1698 89 96 defined $$self{'ignore_class'} ? :
1702 185 0 if (defined $ignore_package)
1703 140 45 if (ref $ignore_package eq 'ARRAY') { }
1704 20 120 if (@{$ignore_package;})
1705 14 26 if defined $_ and ref $_ eq 'Regexp' && $package =~ /$_/ || ref $_ ne 'Regexp' && $package eq $_
1709 10 35 ref $ignore_package eq 'Regexp' ? :
24 21 if ref $ignore_package eq 'Regexp' ? $package =~ /$ignore_package/ : $package eq $ignore_package
1712 147 0 if (defined $ignore_class)
1713 138 9 if (ref $ignore_class eq 'ARRAY') { }
1714 14 124 if (@{$ignore_class;})
1715 10 4 if grep {do { local $@; local $SIG{'__DIE__'}; eval { do { $package->isa($_) } } };} @{$ignore_class;}
1719 4 5 if do { local $@; local $SIG{'__DIE__'}; eval { do { $package->isa($ignore_class) } } }
1733 138 22 if defined $$self{'caller_stack'} and defined $$self{'caller_stack'}[$i]
1740 22 138 unless (defined $call_info{'package'})
1745 74 64 if ($call_info{'has_args'})
1747 48 26 defined $$self{'max_arg_nums'} ? :
1748 25 49 if ($max_arg_nums > 0 and $#args + 1 > $max_arg_nums)
1755 1 137 unless $call_info{'file'}
1756 1 137 unless $call_info{'line'}
1758 54 84 $call_info{'wantarray'} ? :
1760 129 9 wantarray ? :
1767 26 120 if (defined $$info{'evaltext'})
1769 2 24 if ($$info{'is_require'}) { }
1775 21 3 defined $$self{'max_eval_len'} ? :
1781 1 119 $$info{'subroutine'} eq '(eval)' ? :
1789 2 325 unless defined $arg
1791 22 303 if (do { local $@; local $SIG{'__DIE__'}; eval { do { $arg->isa('Exception::Base') } } } or ref $arg)
1798 177 126 defined $$self{'max_arg_len'} ? :
1800 19 284 unless $arg =~ /^-?[\d.]+\z/
1804 303 0 if (not defined *utf8::is_utf{'CODE'} or utf8::is_utf8($arg)) { }
1805 7 751 chr($_) =~ /[[:cntrl:]]|[[:^ascii:]]/ ? :
3 758 $_ > 255 ? :
1823 7 362 unless defined $max
1824 66 303 if ($max > 2 and $max < length $str)
1842 1 20 unless (exists $$attributes{$key}{'default'})
1853 7 13 if ($modifier eq '+') { }
6 7 elsif ($modifier eq '-') { }
1855 5 2 if (ref $old eq 'ARRAY' or ref $value eq 'Regexp') { }
1 1 elsif ($old =~ /^\d+$/) { }
1856 5 0 ref $old eq 'ARRAY' ? :
1857 3 2 ref $value eq 'ARRAY' ? :
1858 9 0 ref $old eq 'ARRAY' ? :
4 5 if grep {$v eq $_;} ref $old eq 'ARRAY' ? @{$old;} : $old
1872 4 2 if (ref $old eq 'ARRAY' or ref $value eq 'Regexp') { }
1 1 elsif ($old =~ /^\d+$/) { }
1873 4 0 ref $old eq 'ARRAY' ? :
1874 3 1 ref $value eq 'ARRAY' ? :
1927 0 470 if ref $$attributes{$key} ne 'HASH'
1928 128 342 unless ($class->can($key))
1929 100 28 unless defined $$attributes{$key}{'is'}
1930 16 12 if ($$attributes{$key}{'is'} eq 'rw') { }
1932 2 14 @_ > 1 ? :
1975 4 0 unless ($class->can($key))
1978 4 0 defined $$self{'defaults'}{'ignore_level'} ? :
8 4 defined $$self{'ignore_level'} ? :
1985 4 20 if $self->_skip_ignored_package($c{'package'})
1987 8 12 if ($ignore_level > 0)
2005 0 28 unless $package
2013 4 0 if (defined $version and $version =~ /^\d/)
2025 0 23 unless $package
2027 2 21 defined $$param{'isa'} ? :
2028 21 2 unless $version
2030 9 14 defined $$param{'has'} ? :
2031 3 20 if (ref $has eq 'ARRAY') { }
2 18 elsif (not ref $has) { }
2038 6 40 unless (ref $$has{$mode})
2039 2 4 defined $$has{$mode} ? :
2044 1 22 unless (defined do { local $SIG{'__DIE__'}; eval { do { $isa->VERSION } } })
2048 1 0 if ($@)
2064 0 22 if ($@)
2076 2 10 if ($attribute =~ /^(isa|version|has)$/ or $isa->can($attribute))
2086 10 4 if $attribute =~ /^(isa|version|has)$/
2087 1 0 unless (exists $$attributes{$attribute}{'default'} or exists $overridden_attributes{$attribute})
2098 3 3 if $property eq 'default'