Die/stat.pm

filter: Statementstmt 91.6% 11 / 12 Branchbran 87.5% 7 / 8 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 2 / 2 Podpod 0.0% 0 / 1 totaltotal 86.9% 20 / 23 CC 5 SCAR 14.8
CC
5
Cov
90%
stat
5.0
BEGIN
1.0
CRAP 4.4
« Die/chroot.pm ↑ Summary Die.pm »
1 package IO::Die;
2  
3 10 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 #NOTE: To get stat(_), do stat(\*_).
6 34 ▶sub stat {
Subroutine stat: called CC=5 SCAR=16.2
Pod undocumented
7 34 my ( $NS, $path_or_fh ) = @_;
8  
9 34 local ( $!, $^E );
10  
11 34 ▶ my $ret = wantarray ? [ CORE::stat($path_or_fh) ] : CORE::stat($path_or_fh);
Branch: 1 branch
BranchTrueFalseTotal
wantarray ? : 32 2 34
12  
13 34 ▶ if ($^E) {
Branch: 1 branch
BranchTrueFalseTotal
if ($^E) 1 33 34
14 1 ▶ if ( __is_a_fh($path_or_fh) ) {
Branch: 1 branch
BranchTrueFalseTotal
if (__is_a_fh($path_or_fh)) 0 1 1
15 0 $NS->__THROW('Stat');
16 }
17  
18 1 $NS->__THROW( 'Stat', path => $path_or_fh );
19 }
20  
21 33 ▶ return wantarray ? @$ret : $ret;
Branch: 1 branch
BranchTrueFalseTotal
wantarray ? : 32 1 33
22 }
23  
24 1 1;
« Die/chroot.pm ↑ Summary Die.pm »