URI/ftp.pm

filter: Statementstmt 100% 27 / 27 Branchbran 100% 6 / 6 Conditioncond 66.6% 2 / 3 MC/DCmcdc 50.0% 1 / 2 Subroutinesub 100% 10 / 10 Podpod 40.0% 2 / 5 totaltotal 90.5% 48 / 53 CC 5 SCAR 6.9
CC
5
Cov
97%
password
4.0
user
2.0
BEGIN
1.0
CRAP 2.0
« URI/tn3270.pm ↑ Summary URI/ldapi.pm »
1 package URI::ftp;
2  
3 8 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 8 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 8 our $VERSION = '5.40';
7  
8 8 ▶use parent qw(URI::_server URI::_userpass);
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 16 ▶sub default_port {21}
Subroutine default_port: called CC=1 SCAR=0.0
Pod documented
11  
12 1 ▶sub encrypt_mode {undef}
Subroutine encrypt_mode: called CC=1 SCAR=0.0
Pod undocumented
13  
14 11 ▶sub path { shift->path_query(@_) } # XXX
Subroutine path: called CC=1 SCAR=0.0
Pod documented
15  
16 23 ▶sub _user { shift->SUPER::user(@_); }
Subroutine _user: called CC=1 SCAR=0.0
17 15 ▶sub _password { shift->SUPER::password(@_); }
Subroutine _password: called CC=1 SCAR=0.0
18  
19 23 ▶sub user {
Subroutine user: called CC=2 SCAR=6.9
Pod undocumented
20 23 my $self = shift;
21 23 my $user = $self->_user(@_);
22 23 ▶ $user = "anonymous" unless defined $user;
Branch: 1 branch
BranchTrueFalseTotal
unless defined $user 8 15 23
23 23 $user;
24 }
25  
26 15 ▶sub password {
Subroutine password: called CC=4 SCAR=13.9
Pod undocumented
27 15 my $self = shift;
28 15 my $pass = $self->_password(@_);
29 15 ▶ unless (defined $pass) {
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $pass) 6 9 15
30 6 my $user = $self->user;
31 6 ▶ if ($user eq 'anonymous' || $user eq 'ftp') {
Branch: 1 branch
BranchTrueFalseTotal
if ($user eq "anonymous" or $user eq "ftp") 3 3 6
Condition66%2/3
$user eq "anonymous" or $user eq "ftp"
l!l&&r!l&&!r
303
MC/DC50%1/2
$user eq "anonymous" or $user eq "ftp"
$user eq "anonymous" $user eq "ftp"
Truth table66%2/3
A or B
A= $user eq "anonymous"B= $user eq "ftp"
ABresult
1X1
011
000
32  
33 # anonymous ftp login password
34 # If there is no ftp anonymous password specified
35 # then we'll just use 'anonymous@'
36 # We don't try to send the read e-mail address because:
37 # - We want to remain anonymous
38 # - We want to stop SPAM
39 # - We don't want to let ftp sites to discriminate by the user,
40 # host, country or ftp client being used.
41 3 $pass = 'anonymous@';
42 }
43 }
44 15 $pass;
45 }
46  
47 8 1;
« URI/tn3270.pm ↑ Summary URI/ldapi.pm »