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 CC 2 SCAR 7.9
CC
2
Cov
61%
short_name
6.0
__ANON__
2.0
new
2.0
CRAP 2.2
« FSP/Handle/Write.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 2 ▶use overload q{""} => sub {
Subroutine BEGIN: called CC=1 SCAR=0.2
Subroutine __ANON__: not called CC=1 SCAR=6.9
7 0 return $_[0]->short_name;
8 2 };
9 2 our $VERSION = $Net::FSP::VERSION;
10  
11 0 ▶sub new {
Subroutine new: not called CC=1 SCAR=6.9
Pod documented
12 0 my ($class, $fsp, $name, %attributes) = @_;
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 {
Subroutine __ANON__: not called CC=1 SCAR=1.2
24 0 return $_[0]{$subname};
25 10 };
26 }
27  
28 0 ▶sub move {
Subroutine move: not called CC=1 SCAR=6.9
Pod documented
29 0 my ($self, $new_name) = @_;
30 0 $self->{fsp}->move_file($self->{name}, $new_name);
31 0 return;
32 }
33  
34 0 ▶sub short_name {
Subroutine short_name: not called CC=2 SCAR=17.9
Pod documented
35 0 my $self = shift;
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__
« FSP/Handle/Write.pm ↑ Summary