Foreign/Attributes/Compat.pm

filter: Statementstmt 66.6% 18 / 27 Branchbran 0.0% 0 / 4 Conditioncond 0.0% 0 / 2 MC/DCmcdc 0.0% 0 / 1 Subroutinesub 66.6% 4 / 6 Podpod 100% 1 / 1 totaltotal 56.1% 23 / 41 CC 4 SCAR 17.5
CC
4
Cov
55%
__ANON__
12.0
new
6.0
BEGIN
1.0
CRAP 5.8
« Foreign/Buffer.pm ↑ Summary Foreign/Constants.pm »
1 package Net::SFTP::Foreign::Attributes::Compat;
2  
3 1 our $VERSION = '0.01';
4  
5 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 1 ▶use Net::SFTP::Foreign::Attributes;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 1 our @ISA = qw(Net::SFTP::Foreign::Attributes);
10  
11 1 my @fields = qw( flags size uid gid perm atime mtime );
12  
13 1 for my $f (@fields) {
14 1 ▶ no strict 'refs';
Subroutine BEGIN: called CC=1 SCAR=0.0
15 0 ▶ *$f = sub { @_ > 1 ? $_[0]->{$f} = $_[1] : $_[0]->{$f} || 0 }
Subroutine __ANON__: not called CC=3 SCAR=24.8
Branch: 1 branch
BranchTrueFalseTotal
@_ > 1 ? : 0 0 0
Condition0%0/2
$_[0]{$f} or 0
l!l
00
MC/DC0%0/1
$_[0]{$f} or 0
$_[0]{$f}
Truth table0%0/2
A
A= $_[0]{$f}
Aresult
11
00
16 7 }
17  
18 0 ▶sub new {
Subroutine new: not called CC=2 SCAR=17.9
Pod documented
19 0 my ($class, %param) = @_;
20  
21 0 my $a = $class->SUPER::new();
22  
23 0 ▶ if (my $stat = $param{Stat}) {
Branch: 1 branch
BranchTrueFalseTotal
if (my $stat = $param{"Stat"}) 0 0 0
24 0 $a->set_size($stat->[7]);
25 0 $a->set_ugid($stat->[4], $stat->[5]);
26 0 $a->set_perm($stat->[2]);
27 0 $a->set_amtime($stat->[8], $stat->[9]);
28 }
29 0 $a;
30 }
31  
32 1 1;
33 __END__
« Foreign/Buffer.pm ↑ Summary Foreign/Constants.pm »