Branch Coverage

blib/lib/Safe/World.pm
Criterion Covered Total %
branch 67 682 9.8


line true false branch
100 0 0 if $IGNORE_EXIT
102 0 0 if ($Safe::World::NOW and ref $Safe::World::NOW eq 'Safe::World') { }
104 0 0 if ($$Safe::World::NOW{'ONEXIT'} and not $$Safe::World::NOW{'EXIT'})
108 0 0 unless $exit eq '0'
118 0 2 if (@_ > 1)
126 2 0 $MAIN_STASH == *{'main::';}{'HASH'} ? :
128 2 0 ref $Safe::World::NOW ? :
131 1 1 if (ref $io eq 'ARRAY')
133 0 2 if (ref $io) { }
1 1 elsif ($io =~ /^(?:main::)*(?:STDOUT|stdout)$/s) { }
1 0 elsif ($io =~ /^(?:(?:main|(SAFEWORLD(?:_CACHE_)?\d+))::)+(?:STDOUT|stdout)$/s) { }
0 0 elsif ($io ne '' and not $io =~ /::/ and not $io =~ /^(?:STDOUT|STDERR|STDIN)$/) { }
135 1 0 $outside ? :
148 2 0 $io ne '' ? :
151 2 0 if ($sel =~ /^(?:(?:main|(SAFEWORLD(?:_CACHE_)?\d+))::)*(?:STDOUT|stdout)$/s)
154 1 1 if ($sel eq 'main::STDOUT' and $SELECT_STDOUT_FIX)
157 2 0 if $io ne ''
174 362 0 $MAIN_STASH == *{'main::';}{'HASH'} ? :
175 0 362 ref $Safe::World::NOW ? :
177 0 362 if ($class eq 'UNIVERSAL' and is_SvBlessed($ref))
179 0 362 if (not $outside) { }
182 0 0 if $class2
196 0 1 if (@_) { }
199 1 0 $MAIN_STASH == *{'main::';}{'HASH'} ? :
201 0 1 unless ($outside)
202 0 0 if ($ret[0] =~ /^(?:main|(?:SAFEWORLD(?:_CACHE_)?\d+))(::.*|)$/)
207 1 0 if wantarray
217 1 22 if ($#_ == 0) { }
223 22 1 $MAIN_STASH == *{'main::';}{'HASH'} ? :
225 0 0 if (not $outside || ref($ref) =~ /^(?:(?:main|(?:SAFEWORLD(?:_CACHE_)?\d+))::)?Safe::World(?:::(?:Compartment|select).*)?$/ and $] >= 5.007 || !(ref($ref) =~ /^(?:(?:main|(?:SAFEWORLD(?:_CACHE_)?\d+))::)?(?:Object::MultiType.*|XML::Smart)$/))
255 0 0 if ($ref and $ref ne 'SCALAR' and $ref ne 'ARRAY' and $ref ne 'HASH' and $ref ne 'CODE' and $ref ne 'GLOB' and $ref ne 'FORMAT' and $ref ne 'REF' and $ref ne 'UNKNOW' and not $ref =~ /^(?:main|(?:SAFEWORLD(?:_CACHE_)?\d+)::)?Safe::World(?:[\w:]*)$/) { }
266 0 0 if ($ref =~ /^(?:main|(?:SAFEWORLD(?:_CACHE_)?\d+))(?:::(.*)|)$/)
333 0 0 if $$this{'NO_IO'}
339 0 0 if $$this{'NO_IO'}
345 0 0 if $$this{'NO_IO'}
358 1 0 if $args{'no_io'}
360 0 1 unless ($$this{'NO_IO'})
366 0 0 unless (ref $$this{'STDOUT'})
367 0 0 unless (ref $$this{'STDIN'})
368 0 0 unless (ref $$this{'STDERR'})
369 0 0 if ($$this{'HEADOUT'} and not ref $$this{'HEADOUT'})
371 0 0 unless (ref($$this{'HEADOUT'}) =~ /^(?:GLOB|SCALAR|CODE)$/)
373 0 0 if ref $$this{'STDOUT'} eq 'SCALAR'
374 0 0 if ref $$this{'STDERR'} eq 'SCALAR'
375 0 0 if ref $$this{'HEADOUT'} eq 'SCALAR'
381 0 0 if exists $args{'autohead'}
382 0 0 if $$this{'HEADOUT'} and not exists $args{'autohead'}
384 0 0 if $$this{'AUTOHEAD'}
385 0 0 if ($$this{'HEADSPLITTER'} eq 'HTML')
392 0 0 if ref $args{'on_closeheaders'} eq 'CODE'
393 0 0 if ref $args{'on_exit'} eq 'CODE'
395 0 0 if ref $args{'on_select'} eq 'CODE'
396 0 0 if ref $args{'on_unselect'} eq 'CODE'
402 0 1 if ($$this{'SHAREDPACK'} and ref $$this{'SHAREDPACK'} ne 'ARRAY')
404 1 0 if ($$this{'SHAREDPACK'})
420 1 0 if (ref $$this{'ENV'} ne 'HASH')
424 1 0 unless ($packname)
425 1 0 $args{'is_cache'} ? :
427 1 0 if $args{'is_cache'}
432 0 1 if $args{'no_set_safeworld'}
433 0 1 if $args{'no_clean'}
441 0 0 if ($$this{'SHAREDPACK'})
447 0 0 unless ($$this{'NO_IO'})
448 0 0 if ($$this{'FLUSH'} and not $$this{'HEADOUT'} and not $$this{'AUTOHEAD'}) { }
457 0 0 if $$this{'STDIN'}
483 0 0 if defined *{'Apache::';}
484 0 0 if defined *{'Win32::';}
494 0 0 $$this{'ENV'} ? :
506 0 0 unless $args{'no_strict'}
510 0 0 if $$this{'NO_IO'}
567 0 0 unless ($$this{'NO_IO'})
568 0 0 if $args{'stdout'}
569 0 0 if $args{'stdin'}
570 0 0 if $args{'stderr'}
571 0 0 if $args{'headout'}
573 0 0 if ($$this{'STDOUT'} and not ref $$this{'STDOUT'})
574 0 0 if ($$this{'STDIN'} and not ref $$this{'STDIN'})
575 0 0 if ($$this{'STDERR'} and not ref $$this{'STDERR'})
576 0 0 if ($$this{'HEADOUT'} and not ref $$this{'HEADOUT'})
578 0 0 unless (ref($$this{'HEADOUT'}) =~ /^(?:GLOB|SCALAR|CODE)$/)
580 0 0 if ref $$this{'STDOUT'} eq 'SCALAR'
581 0 0 if ref $$this{'STDERR'} eq 'SCALAR'
582 0 0 if ref $$this{'HEADOUT'} eq 'SCALAR'
587 0 0 if ($env)
589 0 0 if (ref $$this{'ENV'} ne 'HASH')
594 0 0 $env ? :
604 0 0 unless ($$this{'NO_IO'})
608 0 0 if ($$this{'FLUSH'} and not $$this{'HEADOUT'} and not $$this{'AUTOHEAD'}) { }
617 0 0 if $$this{'STDIN'}
622 0 0 if $sel
645 0 0 if $$this{'NO_IO'}
651 0 0 if ($args{'stdout'})
654 0 0 if ($$this{'STDOUT'} and not ref $$this{'STDOUT'})
656 0 0 if ref $$this{'STDOUT'} eq 'SCALAR'
658 0 0 if $$this{'STDOUT'}
661 0 0 if ($args{'stderr'})
664 0 0 if ($$this{'STDERR'} and not ref $$this{'STDERR'})
666 0 0 if ref $$this{'STDERR'} eq 'SCALAR'
668 0 0 if $$this{'STDERR'}
671 0 0 if ($args{'headout'})
674 0 0 if ($$this{'HEADOUT'} and not ref $$this{'HEADOUT'})
675 0 0 unless (ref($$this{'HEADOUT'}) =~ /^(?:GLOB|SCALAR|CODE)$/)
676 0 0 if ref $$this{'HEADOUT'} eq 'SCALAR'
678 0 0 if $$this{'HEADOUT'}
681 0 0 if ($args{'stdin'})
684 0 0 if ($$this{'STDIN'} and not ref $$this{'STDIN'})
687 0 0 if $$this{'STDIN'}
698 0 0 if (not $SAFE_WORLD_SELECTED_STATIC and $Safe::World::NOW != $_[0])
710 0 0 if ($SAFE_WORLD_SELECTED_STATIC and $Safe::World::NOW == $_[0])
723 0 0 if ($_[0]{'WORLD_SHARED'} and not $_[0]{'DESTROIED'} and $Safe::World::NOW != $_[0]) { }
0 0 elsif ($_[0]{'EXIT'} and not $_[0]{'DESTROIED'} and $Safe::World::NOW != $_[0]) { }
733 0 0 if ($MAIN_STASH != *{'main::';}{'HASH'}) { }
738 0 0 if (wantarray) { }
740 0 0 if $@
745 0 0 if $@
753 0 0 if ($Safe::World::NOW != $_[0])
759 0 0 if (wantarray) { }
761 0 0 if $@
767 0 0 if $@
779 0 0 if ($_[0]{'WORLD_SHARED'} and not $_[0]{'DESTROIED'} and $Safe::World::NOW != $_[0]) { }
0 0 elsif ($_[0]{'EXIT'} and not $_[0]{'DESTROIED'} and $Safe::World::NOW != $_[0]) { }
799 0 0 if $_[0]{'TIESTDERR'}
801 0 0 if ($MAIN_STASH != *{'main::';}{'HASH'}) { }
804 0 0 if (wantarray) { }
806 0 0 if $$Safe::World::NOW{'TIESTDERR'}
811 0 0 if $$Safe::World::NOW{'TIESTDERR'}
817 0 0 if ($Safe::World::NOW != $_[0])
823 0 0 if (wantarray) { }
826 0 0 if $$Safe::World::NOW{'TIESTDERR'}
832 0 0 if $$Safe::World::NOW{'TIESTDERR'}
855 0 0 if (wantarray) { }
876 0 0 if (@_) { }
897 0 0 if (wantarray) { }
902 0 0 if wantarray
918 0 0 if ($var_more)
920 0 0 if ($var_tp eq '$') { }
0 0 elsif ($var_tp eq '@') { }
0 0 elsif ($var_tp eq '%') { }
0 0 elsif ($var_tp eq '*') { }
939 0 0 unless $pack =~ /^\w+(?:::\w+)*(?:::)?$/s
943 0 0 unless ($var_tp)
963 0 0 if ($var_tp eq '$') { }
0 0 elsif ($var_tp eq '@') { }
0 0 elsif ($var_tp eq '%') { }
0 0 elsif ($var_tp eq '*') { }
984 0 0 if ($var_tp eq '$') { }
0 0 elsif ($var_tp eq '@') { }
0 0 elsif ($var_tp eq '%') { }
0 0 elsif ($var_tp eq '*') { }
1003 1 2 if ($Safe::World::NOW != $this)
1011 0 0 $_[1] eq '' ? :
3 0 ref $_[1] ? :
1013 3 0 if ($var_tp eq '$') { }
0 0 elsif ($var_tp eq '@') { }
0 0 elsif ($var_tp eq '%') { }
0 0 elsif ($var_tp eq '*') { }
1014 2 1 if (not $no_parse_ref and ref $val eq 'SCALAR') { }
1018 0 0 if (not $no_parse_ref and ref $val eq 'ARRAY') { }
0 0 elsif (not $no_parse_ref and ref $val eq 'HASH') { }
1023 0 0 if (not $no_parse_ref and ref $val eq 'HASH') { }
0 0 elsif (not $no_parse_ref and ref $val eq 'ARRAY') { }
1028 0 0 if (ref $val eq 'GLOB') { }
1047 0 0 if ($Safe::World::NOW != $this)
1060 0 0 if ($var_tp eq '$') { }
0 0 elsif ($var_tp eq '@') { }
0 0 elsif ($var_tp eq '%') { }
0 0 elsif ($var_tp eq '*') { }
1061 0 0 if (ref $vars{$Key} eq 'SCALAR') { }
1065 0 0 if (ref $vars{$Key} eq 'ARRAY') { }
0 0 elsif (ref $vars{$Key} eq 'HASH') { }
1070 0 0 if (ref $vars{$Key} eq 'HASH') { }
0 0 elsif (ref $vars{$Key} eq 'ARRAY') { }
1075 0 0 if (ref $vars{$Key} eq 'GLOB') { }
1090 0 0 if ($$this{'INSIDE'})
1093 0 0 if (ref $vars ne 'ARRAY')
1101 0 0 if $var eq '$_' or $var eq '$|' or $var eq '$@' or $var eq '$!'
1103 0 0 if (not $var =~ /^\W[\w:]+$/) { }
1123 0 1 if ($$this{'INSIDE'})
1131 0 0 $a =~ /^\*/ ? :
1138 0 0 if $$this{'DONOT_CLEAN'}{$name}
1140 0 0 if ($var_tp eq '$') { }
0 0 elsif ($var_tp eq '@') { }
0 0 elsif ($var_tp eq '%') { }
0 0 elsif ($var_tp eq '*') { }
1155 0 0 ref $_[0] ? :
1156 0 0 $world && ref $_[0] ? :
1163 0 0 if ($world_dependency)
1167 0 0 if (@vars)
1170 0 0 if ($var =~ /^:def\w*$/)
1175 0 0 unless $$this{'TRACK_VARS'}{$root}{$n}{'g'}
1177 0 0 if $$this{'TRACK_VARS'}{$root}{$n}{$t}
1179 0 0 if $world == $this
1181 0 0 if ($root eq $$this{'ROOT'} and $t ne '>' and $t ne '<' and $t ne '*') { }
0 0 elsif ($t eq '*') { }
1182 0 0 if $t eq '$'
1183 0 0 if $t eq '@'
1184 0 0 if $t eq '%'
1197 0 0 if ($set_defaults and !$$this{'TRACK_VARS_DEF'} || $world != $this)
1198 0 0 if $world == $this
1212 0 0 ref $_[0] eq 'HASH' ? :
1213 0 0 unless $track_vars
1216 0 0 if ref $pack_root
1224 0 0 if ($$this{'TRACK_ONLY_LINKED'}{$track_root} and $$this{'TRACK_ONLY_LINKED'}{$track_root} eq '1' && !$$this{'LINKED_WORLDS'}{$track_root} || $$this{'TRACK_ONLY_LINKED'}{$track_root} ne '1' && !$$this{'LINKED_WORLDS'}{$$this{'TRACK_ONLY_LINKED'}{$track_root}})
1234 0 0 if ($track_root ne $pack_root)
1245 0 0 if ($$track_vars{$track_root}{$n}{'*'}) { }
0 0 elsif ($$track_vars{$track_root}{$n}{'>'}) { }
0 0 elsif ($$track_vars{$track_root}{$n}{'<'}) { }
1249 0 0 if ($] < 5.007) { }
1261 0 0 if $$track_vars{$track_root}{$n}{'$'}
1262 0 0 if $$track_vars{$track_root}{$n}{'@'}
1263 0 0 if $$track_vars{$track_root}{$n}{'%'}
1275 1 0 unless $$this{'TRACK_VARS'}
1282 0 0 if ($$this{'TRACK_ONLY_LINKED'}{$track_root} and $$this{'TRACK_ONLY_LINKED'}{$track_root} eq '1' && !$$this{'LINKED_WORLDS'}{$track_root} || $$this{'TRACK_ONLY_LINKED'}{$track_root} ne '1' && !$$this{'LINKED_WORLDS'}{$$this{'TRACK_ONLY_LINKED'}{$track_root}})
1297 0 0 if ($ref = $$this{'TRACK_VARS'}{$track_root}{$n}{'*'}) { }
0 0 elsif ($$this{'TRACK_VARS'}{$track_root}{$n}{'>'}) { }
0 0 elsif ($$this{'TRACK_VARS'}{$track_root}{$n}{'<'}) { }
1301 0 0 if (tied *{"${track_root}::$n";}) { }
1312 0 0 if ($ref = $$this{'TRACK_VARS'}{$track_root}{$n}{'$'})
1313 0 0 $ref eq '1' ? :
1315 0 0 if ($ref = $$this{'TRACK_VARS'}{$track_root}{$n}{'@'})
1316 0 0 $ref eq '1' ? :
1318 0 0 if ($ref = $$this{'TRACK_VARS'}{$track_root}{$n}{'%'})
1319 0 0 $ref eq '1' ? :
1324 0 0 if ($$this{'TRACK_DEPENDENCIES'}{$track_root} or $track_root =~ /CACHE/)
1327 0 0 unless (defined *{$base;}{'HASH'}{$leaf})
1345 0 0 unless $$this{'TRACK_VARS'}
1349 0 0 if ($$this{'TRACK_DEPENDENCIES'}{$track_root} or $track_root =~ /CACHE/)
1352 0 0 unless (defined *{$base;}{'HASH'}{$leaf})
1370 0 0 if ($$this{'INSIDE'})
1379 0 0 if $packs_i eq "$$this{'ROOT'}::$pack_alise"
1399 0 0 if ($$this{'INSIDE'})
1416 0 1 if ($$this{'INSIDE'})
1420 1 0 if ($_[0])
1454 0 0 if $shared_pack{$packs_i} or $packs_i eq ''
1479 0 0 if (not $packs{$shared_pack_i}) { }
1502 0 0 if ($Safe::World::NOW != $this)
1509 0 0 if ($INC{$pm})
1516 0 0 if (@_ and join(' ', @_) =~ /\S/s)
1522 0 0 if ($@) { }
1526 0 0 if not $inc_now{$Key} and $Key =~ /^\w.*?\.pm$/
1531 0 0 if $packs_prev{$packs_now_i}
1537 0 0 if $new_incs{$pm}
1540 0 0 unless %$table
1544 0 0 unless ($Key =~ /::$/)
1546 0 0 unless $has_non_pack
1555 0 0 if (%new_incs)
1558 0 0 if $new_incs{$Key} ne '#not_from_file#'
1559 0 0 $new_incs{$Key} eq '#not_from_file#' ? :
1569 0 0 if ($base_set{join '::', @path})
1573 0 0 if $set
1598 0 0 if ($$this{'INSIDE'} or ref $world ne 'Safe::World' or not $$this{'IS_CACHE'} and $$world{'WORLD_SHARED'} or $$world{'INSIDE'})
1603 0 0 unless $dont_touch_main or $$world{'TRACK_VARS_DEF'}
1611 0 0 if ($Safe::World::NOW == $this) { }
1615 0 0 if ($Safe::World::NOW == $world) { }
1619 0 0 unless ($$inc{$$world{'SHAREDPACK_PM'}{$shared_pack}})
1627 0 0 if (not $$this{'USE_SHARED_INC'}{$Key} || $$inc{$Key} and $Key =~ m[^(?:auto/)?\Q$base\E(?:/|\.)])
1632 0 0 if $$world{'USE_SHARED_INC'}{$Key} != 2
1637 0 0 unless ($dont_touch_main)
1641 0 0 if (not $shared_pack{$Key} and $$table{$Key} =~ /^\*(?:main|$world_root)::/ and not $Key =~ /^(?:.*?::)$/ and not $Key =~ /[^\w:]/s)
1642 0 0 if tied *{"${world_root}::$Key";}
1646 0 0 if defined &{"${world_root}::$Key";}
1652 0 0 if defined &{"${root}::$Key";}
1664 0 0 unless $dont_touch_main
1684 0 0 if ($$this{'INSIDE'} or ref $world ne 'Safe::World' or not $$world{'WORLD_SHARED'} or $$world{'INSIDE'})
1695 0 0 if ($Safe::World::NOW == $this) { }
1699 0 0 if ($Safe::World::NOW == $world) { }
1710 0 0 if ($Key =~ m[^(?:auto/)?\Q$base\E(?:/|\.)]) { }
0 0 elsif ($$inc{$Key} eq '#shared#') { }
1711 0 0 if (not $$world_inc{$Key} and $$inc{$Key} ne '#shared#' and $$world{'USE_SHARED_INC'}{$Key} != 2 and $$world{'USE_SHARED_INC'}{"$base.pm"} != 2)
1723 0 0 unless $dont_touch_main
1728 0 0 if (not $dont_touch_main and $track_this)
1734 0 0 unless ($dont_touch_main)
1738 0 0 if (not $shared_pack{$Key} and $$table{$Key} =~ /^\*(?:main|$root)::(.*)/ and not $Key =~ /^(?:.*?::)$/ and not $Key =~ /[^\w:]/s)
1739 0 0 if tied *{"${world_root}::$Key";}
1747 0 0 if defined &{"${world_root}::WORLDSHARE::$Key";}
1755 0 0 unless @{$$world{'WORLD_SHARED'};}
1759 0 0 if not $dont_touch_main || $$world{'TRACK_VARS_DEF'} and $$world{'SHAREDPACK'} and @{$$world{'SHAREDPACK'};}
1770 1 0 if ($$this{'INSIDE'} or not $WORLDS_LINKS{$this})
1789 0 1 if (ref $_[0] and $_[0]{'INSIDE'} || $Safe::World::NOW == $_[0])
1790 1 0 ref $_[0] ? :
1799 0 0 ref $_[0] ? :
1800 0 0 if (ref $this and $$this{'INSIDE'} || $Safe::World::NOW == $this)
1804 0 0 if $this
1806 0 0 unless $packname =~ /::$/
1809 0 0 unless defined $package
1819 0 0 if (not $symb =~ /::$/ and !($symb =~ /[^\w:]/) || $symb =~ /^\W\w?$/)
1821 0 0 if (defined $$fullname)
1822 0 0 if (defined %$fullname)
1823 0 0 if (defined @$fullname)
1824 0 0 if (defined &$fullname)
1825 0 0 if (*{$fullname;}{'IO'} and fileno $fullname)
1828 0 0 unless ($ok)
1841 0 0 if $$this{'NO_IO'}
1843 0 0 if $$this{'TIESTDERR'}{'LAST_ERROR'} eq $_[0] or $_[0] =~ /#CORE::GLOBAL::exit#/
1859 0 0 if $val eq ''
1861 0 0 if $val =~ /\s/s
1876 0 0 if $$this{'NO_IO'}
1879 0 0 if ($Safe::World::NOW != $this)
1898 0 0 if $$this{'NO_IO'}
1901 0 0 if ($Safe::World::NOW != $this)
1914 0 0 if $$this{'NO_IO'}
1917 0 0 if ($Safe::World::NOW != $this)
1930 0 0 if $$this{'NO_IO'}
1933 0 0 if ref $ref ne 'SCALAR'
1935 0 0 if $$this{'TIESTDOUT'}{'REDIRECT'}
1945 0 0 if $$this{'NO_IO'}
1947 0 0 @{$$this{'TIESTDOUT'}{'REDIRECT_STACK'};} ? :
1954 0 0 if $_[0]{'TIESTDOUT'}
1955 0 0 if $_[0]{'TIESTDOUT'}
1957 0 0 if $_[0]{'TIESTDERR'}
1958 0 0 if $_[0]{'TIESTDERR'}
1966 1 0 if $$this{'NO_IO'}
1970 0 0 if ($#_ == 0)
1971 0 0 if ($set) { }
1975 0 0 if $$this{'TIESTDOUT'}
1984 1 0 if $$this{'NO_IO'}
1987 0 0 if ($Safe::World::NOW != $this)
2000 1 0 if $$this{'NO_IO'}
2003 0 0 if ($Safe::World::NOW != $this)
2035 0 0 unless ($world)
2042 0 0 if $track_root eq $roots_i
2102 0 1 if $$this{'CLEANNED'} or $$this{'NO_CLEAN'} or $Safe::World::NOW == $this
2116 0 0 if ($var_tp eq '$') { }
0 0 elsif ($var_tp eq '@') { }
0 0 elsif ($var_tp eq '%') { }
0 0 elsif ($var_tp eq '*') { }
2146 0 0 if ($var_tp eq '$') { }
0 0 elsif ($var_tp eq '@') { }
0 0 elsif ($var_tp eq '%') { }
0 0 elsif ($var_tp eq '*') { }
2169 0 4 unless defined $package
2187 8 0 unless ($symb =~ /::$/ or $symb =~ /[^\w:]/ or $symb =~ /^[1-9\.]/ or $donot_clean and $$donot_clean{$symb})
2191 0 8 if (defined &$fullname)
2192 0 0 if (my $p = prototype $fullname) { }
2197 0 8 if tied *{$fullname;}
2198 2 6 if (*{$fullname;}{'IO'})
2201 1 7 if (defined *{$fullname;}{'ARRAY'})
2202 0 1 if tied @$fullname
2208 1 7 if (defined *{$fullname;}{'HASH'})
2209 0 1 if tied %$fullname
2215 0 8 if tied $$fullname