blib/lib/Net/FSP/Entry.pm

filter: Statementstmt 64.5% 20 / 31 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 50.0% 5 / 10 Podpod 100% 3 / 3 totaltotal 60.8% 28 / 46 SCAR 8.1
CC
2
Cov
61%
short_name
6.0
__ANON__
2.0
new
2.0
CRAP 2.2
« blib/lib/Net/FSP/Util.pm ↑ Summary
1 package Net::FSP::Entry;
2 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 use overload q{""} => sub {
7 0 ▶ return $_[0]->short_name;
Subroutine __ANON__: not called CC=1 SCAR=6.9
8 2 ▶};
Subroutine BEGIN: called CC=1 SCAR=0.0
9 2 our $VERSION = $Net::FSP::VERSION;
10  
11 sub new {
12 0 ▶ my ($class, $fsp, $name, %attributes) = @_;
Subroutine new: not called CC=1 SCAR=6.9
Pod documented
13 0 $name =~ s{ \A / }{}mx;
14 0 return bless {
15 fsp => $fsp,
16 name => $name,
17 %attributes,
18 }, $class;
19 }
20  
21 2 for my $subname (qw/name type size time link/) {
22 2 ▶ no strict 'refs'; ##no critic strict
Subroutine BEGIN: called CC=1 SCAR=0.0
23 10 *{$subname} = sub {
24 0 ▶ return $_[0]{$subname};
Subroutine __ANON__: not called CC=1 SCAR=6.9
25 10 };
26 }
27  
28 sub move {
29 0 ▶ my ($self, $new_name) = @_;
Subroutine move: not called CC=1 SCAR=6.9
Pod documented
30 0 $self->{fsp}->move_file($self->{name}, $new_name);
31 0 return;
32 }
33  
34 sub short_name {
35 0 ▶ my $self = shift;
Subroutine short_name: not called CC=2 SCAR=17.9
Pod documented
36 0 ▶ $self->{name} =~ / ( [^\/]* ) \z /mx or croak "Couldn't determine short_name";
Branch: 1 branch
BranchTrueFalseTotal
$self->{"name"} =~ m[ ( [^/]* ) \z ]mx or croak("Couldn't determine short_name") 0 0 0
37 0 return $1;
38 }
39  
40 sub accept;
41 sub remove;
42 sub download;
43  
44 2 1;
45  
46 __END__
« blib/lib/Net/FSP/Util.pm ↑ Summary