Branch Coverage

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


line true false branch
166 1 0 if (not $@) { }
182 1 0 if (not $@) { }
254 1 0 if $] >= 5.01
842 1 51 if ($name eq ':all') { }
21 30 elsif ($name =~ /^([+-]?)([a-z0-9_]+)$/) { }
854 16 14 if defined $_[0] and ref $_[0] eq 'HASH'
856 3 27 defined $param->{'version'} ? :
858 29 1 if (caller ne $name)
859 2 27 if eval { do { $name->VERSION($version) } }
868 26 1 if ($@) { }
870 3 23 unless ($@ =~ /Can\'t locate/)
883 0 24 if $name eq 'Exception::Base'
886 1 23 if ($class ne 'Exception::Base')
952 22 50 if (not defined $Class_Attributes{$class}) { }
970 46 4 if ($attributes->{$key}{'is'} eq 'rw')
1031 34 2 if (not ref $self) { }
1033 33 1 if (not ref $_[0]) { }
1035 30 3 if (scalar @_ % 2 == 0) { }
1044 2 1 unless defined $e->{$default_attribute}
1063 1 1 if ($attrs->{$key}{'is'} eq 'rw')
1068 1 2 if (ref $old_e ne $class)
1113 1 18 if (@_ > 1) { }
1123 3 16 if (ref $e and do { local $@; local $SIG{'__DIE__'}; eval { do { $e->isa('Exception::Base') } } }) { }
2 14 elsif ($e eq '') { }
1236 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+$/) { }
1255 0 156 unless @args
1258 36 120 if (scalar @args % 2 == 1)
1260 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) { }
1263 0 0 if (not defined $arrval) { }
0 0 elsif (not ref $arrval and $arrval =~ /^[+-]?\d+$/) { }
0 0 elsif (not $self->_string_attributes) { }
1264 0 0 unless $self->_string_attributes
1268 0 0 if $self->{$numeric_attribute} == $arrval
1275 0 0 if (ref $arrval eq 'CODE') { }
0 0 elsif (ref $arrval eq 'Regexp') { }
1276 0 0 if &$arrval()
1279 0 0 if /$arrval/
1282 0 0 if $_ eq $arrval
1285 0 0 if $arrret
1288 0 0 unless $arrret
1291 4 4 if $self->_string_attributes
1295 0 0 if $self->{$numeric_attribute} != $val
1302 6 15 if (ref $val eq 'CODE') { }
6 9 elsif (ref $val eq 'Regexp') { }
1303 2 4 unless &$val()
1306 2 4 unless /$val/
1309 4 5 if $_ ne $val
1312 17 0 unless @args
1317 6 120 if ($key eq '-default')
1321 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}) { }
1322 9 2 if (ref $val eq 'ARRAY') { }
1325 0 21 unless defined $arrval
1326 5 16 if $self->isa($arrval)
1327 5 16 if $arrret
1329 4 5 unless $arrret
1332 1 1 unless $self->isa($val)
1336 2 2 if (ref $val eq 'ARRAY') { }
1339 0 5 unless defined $arrval
1340 1 4 if exists $self->ATTRS->{$arrval}
1341 1 4 if $arrret
1343 1 1 unless $arrret
1346 1 1 unless $self->ATTRS->{$val}
1352 17 60 if (not defined $arrval) { }
24 36 elsif (not defined $self->{$key}) { }
1353 9 8 unless defined $self->{$key}
1364 9 27 ref $self->{$key} eq 'ARRAY' ? :
1365 8 28 if (ref $arrval eq 'CODE') { }
12 16 elsif (ref $arrval eq 'Regexp') { }
1366 4 4 if &$arrval()
1369 4 8 if /$arrval/
1372 4 12 if $_ eq $arrval
1375 21 32 if $arrret
1377 17 21 unless $arrret
1380 6 6 if exists $self->{$key} and defined $self->{$key}
1384 6 11 if $self->{$key} != $val
1395 10 24 ref $self->{$key} eq 'ARRAY' ? :
1397 12 22 if (ref $val eq 'CODE') { }
12 10 elsif (ref $val eq 'Regexp') { }
1398 4 8 unless &$val()
1401 4 8 unless /$val/
1404 4 6 if $_ ne $val
1433 48 10 defined $self->{'verbosity'} ? :
1437 4 54 if ($message eq '')
1440 4 0 if defined $message
1444 18 40 if ($verbosity == 1) { }
20 20 elsif ($verbosity == 2) { }
16 4 elsif ($verbosity >= 3) { }
1445 4 14 if $message =~ /\n$/
1450 1 19 if $message =~ /\n$/
1482 3 6 if defined $self->{$numeric_attribute}
1483 4 2 if defined $self->{'defaults'}{$numeric_attribute}
1520 0 35 if $self->{'tid'}
1524 30 5 defined $self->{'verbosity'} ? :
1530 10 0 defined $self->{'defaults'}{'ignore_level'} ? :
25 10 defined $self->{'ignore_level'} ? :
1535 43 36 if $self->_skip_ignored_package($c{'package'})
1537 5 31 if ($ignore_level > 0)
1543 31 0 defined $c{'file'} && $c{'file'} ne '' ? :
1548 4 31 unless (@stacktrace)
1552 2 2 defined $c{'file'} && $c{'file'} ne '' ? :
1555 16 19 if ($verbosity >= 3)
1557 4 12 if ($verbosity >= 4)
1562 0 24 if $verbosity == 3 and $self->_skip_ignored_package($c{'package'})
1569 5 19 if $verbosity <= 3 and $self->_skip_ignored_package($package)
1570 19 0 defined $file && $file ne '' ? :
1577 19 16 wantarray ? :
1598 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]}
1612 25 86 ref $_ eq 'ARRAY' ? :
1615 112 24 if defined $_
1653 7 66 defined $self->{'verbosity'} ? :
1654 62 11 if ($verbosity >= 2)
1656 0 62 if defined &threads::tid
1666 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]}
1671 5 126 if ref $_
1677 62 0 if $verbosity == 2 and not $self->_skip_ignored_package($stacktrace_element[0])
1692 88 97 defined $self->{'ignore_package'} ? :
1696 89 96 defined $self->{'ignore_class'} ? :
1698 185 0 if (defined $ignore_package)
1699 140 45 if (ref $ignore_package eq 'ARRAY') { }
1700 20 120 if (@{$ignore_package;})
1701 14 26 if defined $_ and ref $_ eq 'Regexp' && $package =~ /$_/ || ref $_ ne 'Regexp' && $package eq $_
1705 10 35 ref $ignore_package eq 'Regexp' ? :
24 21 if ref $ignore_package eq 'Regexp' ? $package =~ /$ignore_package/ : $package eq $ignore_package
1708 147 0 if (defined $ignore_class)
1709 138 9 if (ref $ignore_class eq 'ARRAY') { }
1710 14 124 if (@{$ignore_class;})
1711 10 4 if grep {do { local $@; local $SIG{'__DIE__'}; eval { do { $package->isa($_) } } };} @{$ignore_class;}
1715 4 5 if do { local $@; local $SIG{'__DIE__'}; eval { do { $package->isa($ignore_class) } } }
1730 138 22 if defined $self->{'caller_stack'} and defined $self->{'caller_stack'}[$i]
1736 22 138 unless (defined $call_info{'package'})
1741 74 64 if ($call_info{'has_args'})
1743 48 26 defined $self->{'max_arg_nums'} ? :
1744 25 49 if ($max_arg_nums > 0 and $#args + 1 > $max_arg_nums)
1751 1 137 unless $call_info{'file'}
1752 1 137 unless $call_info{'line'}
1754 54 84 $call_info{'wantarray'} ? :
1756 129 9 wantarray ? :
1763 26 120 if (defined $info->{'evaltext'})
1765 2 24 if ($info->{'is_require'}) { }
1772 21 3 defined $self->{'max_eval_len'} ? :
1777 1 119 $info->{'subroutine'} eq '(eval)' ? :
1785 2 325 unless defined $arg
1787 22 303 if (do { local $@; local $SIG{'__DIE__'}; eval { do { $arg->isa('Exception::Base') } } } or ref $arg)
1794 177 126 defined $self->{'max_arg_len'} ? :
1796 19 284 unless $arg =~ /^-?[\d.]+\z/
1799 303 0 if (not defined *utf8::is_utf{'CODE'} or utf8::is_utf8($arg)) { }
1800 7 751 chr($_) =~ /[[:cntrl:]]|[[:^ascii:]]/ ? :
3 758 $_ > 255 ? :
1818 7 362 unless defined $max
1819 66 303 if ($max > 2 and $max < length $str)
1836 1 20 unless (exists $attributes->{$key}{'default'})
1847 7 13 if ($modifier eq '+') { }
6 7 elsif ($modifier eq '-') { }
1849 5 2 if (ref $old eq 'ARRAY' or ref $value eq 'Regexp') { }
1 1 elsif ($old =~ /^\d+$/) { }
1850 5 0 ref $old eq 'ARRAY' ? :
1851 3 2 ref $value eq 'ARRAY' ? :
1852 9 0 ref $old eq 'ARRAY' ? :
4 5 if grep {$v eq $_;} ref $old eq 'ARRAY' ? @{$old;} : $old
1866 4 2 if (ref $old eq 'ARRAY' or ref $value eq 'Regexp') { }
1 1 elsif ($old =~ /^\d+$/) { }
1867 4 0 ref $old eq 'ARRAY' ? :
1868 3 1 ref $value eq 'ARRAY' ? :
1921 0 470 if ref $attributes->{$key} ne 'HASH'
1922 128 342 unless ($class->can($key))
1923 100 28 unless defined $attributes->{$key}{'is'}
1924 16 12 if ($attributes->{$key}{'is'} eq 'rw') { }
1927 2 14 @_ > 1 ? :
1969 4 0 unless ($class->can($key))
1976 4 0 defined $self->{'defaults'}{'ignore_level'} ? :
8 4 defined $self->{'ignore_level'} ? :
1979 4 20 if $self->_skip_ignored_package($c{'package'})
1981 8 12 if ($ignore_level > 0)
1999 0 28 unless $package
2007 4 0 if (defined $version and $version =~ /^\d/)
2019 0 23 unless $package
2021 2 21 defined $param->{'isa'} ? :
2022 21 2 unless $version
2024 9 14 defined $param->{'has'} ? :
2025 3 20 if (ref $has eq 'ARRAY') { }
2 18 elsif (not ref $has) { }
2032 6 40 unless (ref $has->{$mode})
2033 2 4 defined $has->{$mode} ? :
2038 1 22 unless (defined do { local $SIG{'__DIE__'}; eval { do { $isa->VERSION } } })
2042 1 0 if ($@)
2058 0 22 if ($@)
2070 2 10 if ($attribute =~ /^(isa|version|has)$/ or $isa->can($attribute))
2080 10 4 if $attribute =~ /^(isa|version|has)$/
2081 1 0 unless (exists $attributes->{$attribute}{'default'} or exists $overridden_attributes{$attribute})
2092 3 3 if $property eq 'default'