| 1 | package IO::All::File; | ||||||||||||||||||||||||||||
| 2 | 3 | ▶ | use IO::All::Base; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 3 | 3 | extends 'IO::All::Filesys'; | |||||||||||||||||||||||||||
| 4 | |||||||||||||||||||||||||||||
| 5 | 3 | option 'utf8'; | |||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||
| 7 | 3 | has handle => (); | |||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||
| 9 | # Upgrade from IO::All to IO::All::Dir | ||||||||||||||||||||||||||||
| 10 | 3 | ▶ | use constant upgrade_methods => [qw(file print)]; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||
| 12 | 4 | ▶ | sub can_upgrade { | ||||||||||||||||||||||||||
|
Subroutine
can_upgrade: called CC=3 SCAR=11.0
Pod
undocumented
| |||||||||||||||||||||||||||||
| 13 | 4 | my ($self, $object) = @_; | |||||||||||||||||||||||||||
| 14 | 4 | my $location = $object->location; | |||||||||||||||||||||||||||
| 15 | return if | ||||||||||||||||||||||||||||
| 16 | 4 | ▶ | not defined $location or | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
defined $location and length $location
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
| |||||||||||||||||||||||||||||
| 17 | not length $location; | ||||||||||||||||||||||||||||
| 18 | 3 | -f $location; | |||||||||||||||||||||||||||
| 19 | } | ||||||||||||||||||||||||||||
| 20 | |||||||||||||||||||||||||||||
| 21 | # | ||||||||||||||||||||||||||||
| 22 | # Worker Methods: | ||||||||||||||||||||||||||||
| 23 | # | ||||||||||||||||||||||||||||
| 24 | |||||||||||||||||||||||||||||
| 25 | 2 | ▶ | sub file { | ||||||||||||||||||||||||||
|
Subroutine
file: called CC=2 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 26 | 2 | my $self = shift; | |||||||||||||||||||||||||||
| 27 | 2 | ▶ | $self->name(shift) if @_; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 28 | 2 | return $self; | |||||||||||||||||||||||||||
| 29 | } | ||||||||||||||||||||||||||||
| 30 | |||||||||||||||||||||||||||||
| 31 | 3 | ▶ | sub open { | ||||||||||||||||||||||||||
|
Subroutine
open: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||
| 32 | 3 | my $self = shift; | |||||||||||||||||||||||||||
| 33 | 3 | my $fh; | |||||||||||||||||||||||||||
| 34 | 3 | open $fh, '<', $self->name; | |||||||||||||||||||||||||||
| 35 | 3 | $self->handle($fh); | |||||||||||||||||||||||||||
| 36 | 3 | return $self; | |||||||||||||||||||||||||||
| 37 | } | ||||||||||||||||||||||||||||
| 38 | |||||||||||||||||||||||||||||
| 39 | 3 | ▶ | sub all { | ||||||||||||||||||||||||||
|
Subroutine
all: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||
| 40 | 3 | my $self = shift; | |||||||||||||||||||||||||||
| 41 | 3 | my $fh = $self->open->handle; | |||||||||||||||||||||||||||
| 42 | 3 | return do { local $/; <$fh> } | |||||||||||||||||||||||||||
| 43 | } | ||||||||||||||||||||||||||||
| 44 | |||||||||||||||||||||||||||||
| 45 | 0 | ▶ | sub print { | ||||||||||||||||||||||||||
|
Subroutine
print: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 46 | 0 | my $self = shift; | |||||||||||||||||||||||||||
| 47 | 0 | CORE::print(@_); | |||||||||||||||||||||||||||
| 48 | } | ||||||||||||||||||||||||||||
| 49 | |||||||||||||||||||||||||||||
| 50 | 3 | 1; | |||||||||||||||||||||||||||