IO/All/Dir.pm

filter: Statementstmt 54.5% 12 / 22 Branchbran 20.0% 2 / 10 Conditioncond 66.6% 2 / 3 MC/DCmcdc 50.0% 1 / 2 Subroutinesub 60.0% 3 / 5 Podpod 0.0% 0 / 3 totaltotal 44.4% 20 / 45 CC 7 SCAR 22.4
CC
7
Cov
46%
mkdir
20.0
dir
6.0
can_upgrade
3.0
CRAP 9.4
↑ Summary IO/All/Base.pm »
1 package IO::All::Dir;
2 3 ▶use IO::All::Base;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 3 extends 'IO::All::Filesys';
4  
5 # Upgrade from IO::All to IO::All::Dir
6 3 ▶use constant upgrade_methods => [qw(dir mkdir)];
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 2 ▶sub can_upgrade {
Subroutine can_upgrade: called CC=3 SCAR=11.0
Pod undocumented
9 2 my ($self, $object) = @_;
10 2 my $location = $object->location;
11 return if
12 2 ▶ not defined $location or
Branch: 1 branch
BranchTrueFalseTotal
unless defined $location and length $location 1 1 2
Condition66%2/3
defined $location and length $location
!ll&&!rl&&r
101
MC/DC50%1/2
defined $location and length $location
defined $location length $location
Truth table66%2/3
A and B
A= defined $locationB= length $location
ABresult
0X0
100
111
13 not length $location;
14 1 -d $location;
15 }
16  
17 0 ▶sub dir {
Subroutine dir: not called CC=2 SCAR=17.9
Pod undocumented
18 0 my $self = shift;
19 0 ▶ $self->name(shift) if @_;
Branch: 1 branch
BranchTrueFalseTotal
if @_ 0 0 0
20 0 return $self;
21 }
22  
23 0 ▶sub mkdir {
Subroutine mkdir: not called CC=4 SCAR=30.0
Pod undocumented
24 0 my ($self) = @_;
25 0 my $name = $self->name;
26 0 my $strict = $self->{_strict};
27 0 ▶ if (-d $name) {
Branch: 1 branch
BranchTrueFalseTotal
if (-d $name) 0 0 0
28 0 ▶ return unless $strict;
Branch: 1 branch
BranchTrueFalseTotal
unless $strict 0 0 0
29 0 $self->throw("Can't mkdir $name. Directory already exists.");
30 }
31 0 ▶ CORE::mkdir($name) or $self->throw("mkdir $name failed: $!");
Branch: 1 branch
BranchTrueFalseTotal
CORE::mkdir $name or $self->throw("mkdir $name failed: $!") 0 0 0
32 }
33  
34 3 1;
↑ Summary IO/All/Base.pm »