| 1 | package Net::SFTP::Foreign::Attributes; | ||||||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||||||
| 3 | 3 | our $VERSION = '1.68_05'; | |||||||||||||||||||||||||||||||
| 4 | |||||||||||||||||||||||||||||||||
| 5 | 3 | ▶ | use strict; | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 6 | 3 | ▶ | use warnings; | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 7 | 3 | ▶ | use Carp; | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||||||
| 9 | 3 | ▶ | use Net::SFTP::Foreign::Constants qw( :att ); | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 10 | 3 | ▶ | use Net::SFTP::Foreign::Buffer; | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||||||
| 12 | 3 | ▶ | sub new { | ||||||||||||||||||||||||||||||
|
Subroutine
new: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||
| 13 | 3 | my $class = shift; | |||||||||||||||||||||||||||||||
| 14 | 3 | return bless { flags => 0}, $class; | |||||||||||||||||||||||||||||||
| 15 | } | ||||||||||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||||||||||
| 17 | 0 | ▶ | sub new_from_stat { | ||||||||||||||||||||||||||||||
|
Subroutine
new_from_stat: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||
| 18 | 0 | ▶ | if (@_ > 1) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 19 | 0 | my ($class, undef, undef, $mode, undef, | |||||||||||||||||||||||||||||||
| 20 | $uid, $gid, undef, $size, $atime, $mtime) = @_; | ||||||||||||||||||||||||||||||||
| 21 | 0 | my $self = $class->new; | |||||||||||||||||||||||||||||||
| 22 | |||||||||||||||||||||||||||||||||
| 23 | 0 | $self->set_perm($mode); | |||||||||||||||||||||||||||||||
| 24 | 0 | $self->set_ugid($uid, $gid); | |||||||||||||||||||||||||||||||
| 25 | 0 | $self->set_size($size); | |||||||||||||||||||||||||||||||
| 26 | 0 | $self->set_amtime($atime, $mtime); | |||||||||||||||||||||||||||||||
| 27 | 0 | return $self; | |||||||||||||||||||||||||||||||
| 28 | } | ||||||||||||||||||||||||||||||||
| 29 | 0 | return undef; | |||||||||||||||||||||||||||||||
| 30 | } | ||||||||||||||||||||||||||||||||
| 31 | |||||||||||||||||||||||||||||||||
| 32 | 0 | ▶ | sub new_from_buffer { | ||||||||||||||||||||||||||||||
|
Subroutine
new_from_buffer: not called CC=8 SCAR=42.8
Pod
documented
| |||||||||||||||||||||||||||||||||
| 33 | 0 | my ($class, $buf) = @_; | |||||||||||||||||||||||||||||||
| 34 | 0 | my $self = $class->new; | |||||||||||||||||||||||||||||||
| 35 | 0 | my $flags = $self->{flags} = $buf->get_int32_untaint; | |||||||||||||||||||||||||||||||
| 36 | |||||||||||||||||||||||||||||||||
| 37 | 0 | ▶ | if ($flags & SSH2_FILEXFER_ATTR_SIZE) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 38 | 0 | $self->{size} = $buf->get_int64_untaint; | |||||||||||||||||||||||||||||||
| 39 | } | ||||||||||||||||||||||||||||||||
| 40 | |||||||||||||||||||||||||||||||||
| 41 | 0 | ▶ | if ($flags & SSH2_FILEXFER_ATTR_UIDGID) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 42 | 0 | $self->{uid} = $buf->get_int32_untaint; | |||||||||||||||||||||||||||||||
| 43 | 0 | $self->{gid} = $buf->get_int32_untaint; | |||||||||||||||||||||||||||||||
| 44 | } | ||||||||||||||||||||||||||||||||
| 45 | |||||||||||||||||||||||||||||||||
| 46 | 0 | ▶ | if ($flags & SSH2_FILEXFER_ATTR_PERMISSIONS) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 47 | 0 | $self->{perm} = $buf->get_int32_untaint; | |||||||||||||||||||||||||||||||
| 48 | } | ||||||||||||||||||||||||||||||||
| 49 | |||||||||||||||||||||||||||||||||
| 50 | 0 | ▶ | if ($flags & SSH2_FILEXFER_ATTR_ACMODTIME) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 51 | 0 | $self->{atime} = $buf->get_int32_untaint; | |||||||||||||||||||||||||||||||
| 52 | 0 | $self->{mtime} = $buf->get_int32_untaint; | |||||||||||||||||||||||||||||||
| 53 | } | ||||||||||||||||||||||||||||||||
| 54 | |||||||||||||||||||||||||||||||||
| 55 | 0 | ▶ | if ($flags & SSH2_FILEXFER_ATTR_EXTENDED) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 56 | 0 | my $n = $buf->get_int32; | |||||||||||||||||||||||||||||||
| 57 | 0 | ▶ | $n >= 0 and $n <= 10000 or return undef; | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$n >= 0 and $n <= 10000
MC/DC0%0/2
$n >= 0 and $n <= 10000
$n >= 0
$n <= 10000
Truth table0%0/3
A and B
A= $n >= 0B= $n <= 10000
| |||||||||||||||||||||||||||||||||
| 58 | 0 | my @pairs = map $buf->get_str, 1..2*$n; | |||||||||||||||||||||||||||||||
| 59 | 0 | $self->{extended} = \@pairs; | |||||||||||||||||||||||||||||||
| 60 | } | ||||||||||||||||||||||||||||||||
| 61 | |||||||||||||||||||||||||||||||||
| 62 | 0 | $self; | |||||||||||||||||||||||||||||||
| 63 | } | ||||||||||||||||||||||||||||||||
| 64 | |||||||||||||||||||||||||||||||||
| 65 | 0 | ▶ | sub skip_from_buffer { | ||||||||||||||||||||||||||||||
|
Subroutine
skip_from_buffer: not called CC=8 SCAR=42.8
Pod
undocumented
| |||||||||||||||||||||||||||||||||
| 66 | 0 | my ($class, $buf) = @_; | |||||||||||||||||||||||||||||||
| 67 | 0 | my $flags = $buf->get_int32; | |||||||||||||||||||||||||||||||
| 68 | 0 | ▶ | if ($flags == ( SSH2_FILEXFER_ATTR_SIZE | | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 69 | SSH2_FILEXFER_ATTR_UIDGID | | ||||||||||||||||||||||||||||||||
| 70 | SSH2_FILEXFER_ATTR_PERMISSIONS | | ||||||||||||||||||||||||||||||||
| 71 | SSH2_FILEXFER_ATTR_ACMODTIME )) { | ||||||||||||||||||||||||||||||||
| 72 | 0 | $buf->skip_bytes(28); | |||||||||||||||||||||||||||||||
| 73 | } | ||||||||||||||||||||||||||||||||
| 74 | else { | ||||||||||||||||||||||||||||||||
| 75 | 0 | my $len = 0; | |||||||||||||||||||||||||||||||
| 76 | 0 | ▶ | $len += 8 if $flags & SSH2_FILEXFER_ATTR_SIZE; | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 77 | 0 | ▶ | $len += 8 if $flags & SSH2_FILEXFER_ATTR_UIDGID; | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 78 | 0 | ▶ | $len += 4 if $flags & SSH2_FILEXFER_ATTR_PERMISSIONS; | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 79 | 0 | ▶ | $len += 8 if $flags & SSH2_FILEXFER_ATTR_ACMODTIME; | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 80 | 0 | $buf->skip_bytes($len); | |||||||||||||||||||||||||||||||
| 81 | 0 | ▶ | if ($flags & SSH2_FILEXFER_ATTR_EXTENDED) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 82 | 0 | my $n = $buf->get_int32; | |||||||||||||||||||||||||||||||
| 83 | 0 | $buf->skip_str, $buf->skip_str for (1..$n); | |||||||||||||||||||||||||||||||
| 84 | } | ||||||||||||||||||||||||||||||||
| 85 | } | ||||||||||||||||||||||||||||||||
| 86 | } | ||||||||||||||||||||||||||||||||
| 87 | |||||||||||||||||||||||||||||||||
| 88 | 0 | ▶ | sub as_buffer { | ||||||||||||||||||||||||||||||
|
Subroutine
as_buffer: not called CC=7 SCAR=40.3
Pod
documented
| |||||||||||||||||||||||||||||||||
| 89 | 0 | my $a = shift; | |||||||||||||||||||||||||||||||
| 90 | 0 | my $buf = Net::SFTP::Foreign::Buffer->new(int32 => $a->{flags}); | |||||||||||||||||||||||||||||||
| 91 | |||||||||||||||||||||||||||||||||
| 92 | 0 | ▶ | if ($a->{flags} & SSH2_FILEXFER_ATTR_SIZE) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 93 | 0 | $buf->put_int64(int $a->{size}); | |||||||||||||||||||||||||||||||
| 94 | } | ||||||||||||||||||||||||||||||||
| 95 | 0 | ▶ | if ($a->{flags} & SSH2_FILEXFER_ATTR_UIDGID) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 96 | 0 | $buf->put(int32 => $a->{uid}, int32 => $a->{gid}); | |||||||||||||||||||||||||||||||
| 97 | } | ||||||||||||||||||||||||||||||||
| 98 | 0 | ▶ | if ($a->{flags} & SSH2_FILEXFER_ATTR_PERMISSIONS) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 99 | 0 | $buf->put_int32($a->{perm}); | |||||||||||||||||||||||||||||||
| 100 | } | ||||||||||||||||||||||||||||||||
| 101 | 0 | ▶ | if ($a->{flags} & SSH2_FILEXFER_ATTR_ACMODTIME) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 102 | 0 | $buf->put(int32 => $a->{atime}, int32 => $a->{mtime}); | |||||||||||||||||||||||||||||||
| 103 | } | ||||||||||||||||||||||||||||||||
| 104 | 0 | ▶ | if ($a->{flags} & SSH2_FILEXFER_ATTR_EXTENDED) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 105 | 0 | my $pairs = $a->{extended}; | |||||||||||||||||||||||||||||||
| 106 | 0 | $buf->put_int32(int(@$pairs / 2)); | |||||||||||||||||||||||||||||||
| 107 | 0 | $buf->put_str($_) for @$pairs; | |||||||||||||||||||||||||||||||
| 108 | } | ||||||||||||||||||||||||||||||||
| 109 | |||||||||||||||||||||||||||||||||
| 110 | 0 | $buf; | |||||||||||||||||||||||||||||||
| 111 | } | ||||||||||||||||||||||||||||||||
| 112 | |||||||||||||||||||||||||||||||||
| 113 | 0 | ▶ | sub flags { shift->{flags} } | ||||||||||||||||||||||||||||||
|
Subroutine
flags: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||
| 114 | |||||||||||||||||||||||||||||||||
| 115 | 0 | ▶ | sub size { shift->{size} } | ||||||||||||||||||||||||||||||
|
Subroutine
size: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||
| 116 | |||||||||||||||||||||||||||||||||
| 117 | 0 | ▶ | sub set_size { | ||||||||||||||||||||||||||||||
|
Subroutine
set_size: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||||||||||||||||||||||
| 118 | 0 | my ($self, $size) = @_; | |||||||||||||||||||||||||||||||
| 119 | 0 | ▶ | if (defined $size) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 120 | 0 | $self->{flags} |= SSH2_FILEXFER_ATTR_SIZE; | |||||||||||||||||||||||||||||||
| 121 | 0 | $self->{size} = $size; | |||||||||||||||||||||||||||||||
| 122 | } | ||||||||||||||||||||||||||||||||
| 123 | else { | ||||||||||||||||||||||||||||||||
| 124 | 0 | $self->{flags} &= ~SSH2_FILEXFER_ATTR_SIZE; | |||||||||||||||||||||||||||||||
| 125 | delete $self->{size} | ||||||||||||||||||||||||||||||||
| 126 | 0 | } | |||||||||||||||||||||||||||||||
| 127 | } | ||||||||||||||||||||||||||||||||
| 128 | |||||||||||||||||||||||||||||||||
| 129 | 0 | ▶ | sub uid { shift->{uid} } | ||||||||||||||||||||||||||||||
|
Subroutine
uid: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||
| 130 | |||||||||||||||||||||||||||||||||
| 131 | 0 | ▶ | sub gid { shift->{gid} } | ||||||||||||||||||||||||||||||
|
Subroutine
gid: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||
| 132 | |||||||||||||||||||||||||||||||||
| 133 | 0 | ▶ | sub set_ugid { | ||||||||||||||||||||||||||||||
|
Subroutine
set_ugid: not called CC=5 SCAR=34.0
Pod
documented
| |||||||||||||||||||||||||||||||||
| 134 | 0 | my ($self, $uid, $gid) = @_; | |||||||||||||||||||||||||||||||
| 135 | 0 | ▶ | if (defined $uid and defined $gid) { | ||||||||||||||||||||||||||||||
|
Branch: 2 branches
Condition0%0/3
defined $uid and defined $gid
MC/DC0%0/2
defined $uid and defined $gid
defined $uid
defined $gid
Truth table0%0/3
A and B
A= defined $uidB= defined $gid
| |||||||||||||||||||||||||||||||||
| 136 | 0 | $self->{flags} |= SSH2_FILEXFER_ATTR_UIDGID; | |||||||||||||||||||||||||||||||
| 137 | 0 | $self->{uid} = $uid; | |||||||||||||||||||||||||||||||
| 138 | 0 | $self->{gid} = $gid; | |||||||||||||||||||||||||||||||
| 139 | } | ||||||||||||||||||||||||||||||||
| 140 | ▶ | elsif (!defined $uid and !defined $gid) { | |||||||||||||||||||||||||||||||
|
Condition0%0/3
defined $uid || defined $gid
MC/DC0%0/2
defined $uid || defined $gid
defined $uid
defined $gid
Truth table0%0/3
A || B
A= defined $uidB= defined $gid
| |||||||||||||||||||||||||||||||||
| 141 | 0 | $self->{flags} &= ~SSH2_FILEXFER_ATTR_UIDGID; | |||||||||||||||||||||||||||||||
| 142 | 0 | delete $self->{uid}; | |||||||||||||||||||||||||||||||
| 143 | 0 | delete $self->{gid}; | |||||||||||||||||||||||||||||||
| 144 | } | ||||||||||||||||||||||||||||||||
| 145 | else { | ||||||||||||||||||||||||||||||||
| 146 | 0 | croak "wrong arguments for set_ugid" | |||||||||||||||||||||||||||||||
| 147 | } | ||||||||||||||||||||||||||||||||
| 148 | } | ||||||||||||||||||||||||||||||||
| 149 | |||||||||||||||||||||||||||||||||
| 150 | 0 | ▶ | sub perm { shift->{perm} } | ||||||||||||||||||||||||||||||
|
Subroutine
perm: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||
| 151 | |||||||||||||||||||||||||||||||||
| 152 | 0 | ▶ | sub set_perm { | ||||||||||||||||||||||||||||||
|
Subroutine
set_perm: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||||||||||||||||||||||
| 153 | 0 | my ($self, $perm) = @_; | |||||||||||||||||||||||||||||||
| 154 | 0 | ▶ | if (defined $perm) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 155 | 0 | $self->{flags} |= SSH2_FILEXFER_ATTR_PERMISSIONS; | |||||||||||||||||||||||||||||||
| 156 | 0 | $self->{perm} = $perm; | |||||||||||||||||||||||||||||||
| 157 | } | ||||||||||||||||||||||||||||||||
| 158 | else { | ||||||||||||||||||||||||||||||||
| 159 | 0 | $self->{flags} &= ~SSH2_FILEXFER_ATTR_PERMISSIONS; | |||||||||||||||||||||||||||||||
| 160 | delete $self->{perm} | ||||||||||||||||||||||||||||||||
| 161 | 0 | } | |||||||||||||||||||||||||||||||
| 162 | } | ||||||||||||||||||||||||||||||||
| 163 | |||||||||||||||||||||||||||||||||
| 164 | 0 | ▶ | sub atime { shift->{atime} } | ||||||||||||||||||||||||||||||
|
Subroutine
atime: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||
| 165 | |||||||||||||||||||||||||||||||||
| 166 | 0 | ▶ | sub mtime { shift->{mtime} } | ||||||||||||||||||||||||||||||
|
Subroutine
mtime: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||
| 167 | |||||||||||||||||||||||||||||||||
| 168 | 0 | ▶ | sub set_amtime { | ||||||||||||||||||||||||||||||
|
Subroutine
set_amtime: not called CC=5 SCAR=34.0
Pod
documented
| |||||||||||||||||||||||||||||||||
| 169 | 0 | my ($self, $atime, $mtime) = @_; | |||||||||||||||||||||||||||||||
| 170 | 0 | ▶ | if (defined $atime and defined $mtime) { | ||||||||||||||||||||||||||||||
|
Branch: 2 branches
Condition0%0/3
defined $atime and defined $mtime
MC/DC0%0/2
defined $atime and defined $mtime
defined $atime
defined $mtime
Truth table0%0/3
A and B
A= defined $atimeB= defined $mtime
| |||||||||||||||||||||||||||||||||
| 171 | 0 | $self->{flags} |= SSH2_FILEXFER_ATTR_ACMODTIME; | |||||||||||||||||||||||||||||||
| 172 | 0 | $self->{atime} = $atime; | |||||||||||||||||||||||||||||||
| 173 | 0 | $self->{mtime} = $mtime; | |||||||||||||||||||||||||||||||
| 174 | } | ||||||||||||||||||||||||||||||||
| 175 | ▶ | elsif (!defined $atime and !defined $mtime) { | |||||||||||||||||||||||||||||||
|
Condition0%0/3
defined $atime || defined $mtime
MC/DC0%0/2
defined $atime || defined $mtime
defined $atime
defined $mtime
Truth table0%0/3
A || B
A= defined $atimeB= defined $mtime
| |||||||||||||||||||||||||||||||||
| 176 | 0 | $self->{flags} &= ~SSH2_FILEXFER_ATTR_ACMODTIME; | |||||||||||||||||||||||||||||||
| 177 | 0 | delete $self->{atime}; | |||||||||||||||||||||||||||||||
| 178 | 0 | delete $self->{mtime}; | |||||||||||||||||||||||||||||||
| 179 | } | ||||||||||||||||||||||||||||||||
| 180 | else { | ||||||||||||||||||||||||||||||||
| 181 | 0 | croak "wrong arguments for set_amtime" | |||||||||||||||||||||||||||||||
| 182 | } | ||||||||||||||||||||||||||||||||
| 183 | } | ||||||||||||||||||||||||||||||||
| 184 | |||||||||||||||||||||||||||||||||
| 185 | 0 | ▶ | sub extended { @{shift->{extended} || [] } } | ||||||||||||||||||||||||||||||
|
Subroutine
extended: not called CC=2 SCAR=17.9
Pod
documented
Condition0%0/2
+(shift())->{'extended'} || []
MC/DC0%0/1
+(shift())->{'extended'} || []
+(shift())->{'extended'}
Truth table0%0/2
A
A= +(shift())->{'extended'}
| |||||||||||||||||||||||||||||||||
| 186 | |||||||||||||||||||||||||||||||||
| 187 | 0 | ▶ | sub set_extended { | ||||||||||||||||||||||||||||||
|
Subroutine
set_extended: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||||||||||||||||||||||||
| 188 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||
| 189 | 0 | ▶ | @_ & 1 and croak "odd number of arguments passed to set_extended"; | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 190 | 0 | ▶ | if (@_) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 191 | 0 | $self->{flags} |= SSH2_FILEXFER_ATTR_EXTENDED; | |||||||||||||||||||||||||||||||
| 192 | 0 | $self->{extended} = [@_]; | |||||||||||||||||||||||||||||||
| 193 | } | ||||||||||||||||||||||||||||||||
| 194 | else { | ||||||||||||||||||||||||||||||||
| 195 | 0 | $self->{flags} &= ~SSH2_FILEXFER_ATTR_EXTENDED; | |||||||||||||||||||||||||||||||
| 196 | 0 | delete $self->{extended}; | |||||||||||||||||||||||||||||||
| 197 | } | ||||||||||||||||||||||||||||||||
| 198 | } | ||||||||||||||||||||||||||||||||
| 199 | |||||||||||||||||||||||||||||||||
| 200 | 0 | ▶ | sub append_extended { | ||||||||||||||||||||||||||||||
|
Subroutine
append_extended: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||||||||||||||||||||||||
| 201 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||
| 202 | 0 | ▶ | @_ & 1 and croak "odd number of arguments passed to append_extended"; | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 203 | 0 | my $pairs = $self->{extended}; | |||||||||||||||||||||||||||||||
| 204 | 0 | ▶ | if (@$pairs) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 205 | 0 | push @$pairs, @_; | |||||||||||||||||||||||||||||||
| 206 | } | ||||||||||||||||||||||||||||||||
| 207 | else { | ||||||||||||||||||||||||||||||||
| 208 | 0 | $self->set_extended(@_); | |||||||||||||||||||||||||||||||
| 209 | } | ||||||||||||||||||||||||||||||||
| 210 | } | ||||||||||||||||||||||||||||||||
| 211 | |||||||||||||||||||||||||||||||||
| 212 | 0 | ▶ | sub clone { | ||||||||||||||||||||||||||||||
|
Subroutine
clone: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||
| 213 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||
| 214 | 0 | my $clone = { %$self }; | |||||||||||||||||||||||||||||||
| 215 | 0 | bless $clone, ref $self; | |||||||||||||||||||||||||||||||
| 216 | 0 | $clone; | |||||||||||||||||||||||||||||||
| 217 | } | ||||||||||||||||||||||||||||||||
| 218 | |||||||||||||||||||||||||||||||||
| 219 | 3 | 1; | |||||||||||||||||||||||||||||||
| 220 | __END__ | ||||||||||||||||||||||||||||||||