Box/Net.pm

filter: Statementstmt 60.2% 47 / 78 Branchbran 0.0% 0 / 14 Conditioncond 0.0% 0 / 23 MC/DCmcdc 0.0% 0 / 13 Subroutinesub 83.3% 15 / 18 Podpod 66.6% 2 / 3 totaltotal 42.9% 64 / 149 CC 17 SCAR 41.4
CC
17
Cov
41%
init
156.0
url
42.0
create
2.0
CRAP 63.0
« Box/Thread/Manager.pm ↑ Summary Box/Thread/Node.pm »
1 # Copyrights 2001-2020 by [Mark Overmeer].
2 # For other contributors see ChangeLog.
3 # See the manual pages for details on the licensing terms.
4 # Pod stripped from pm file by OODoc 2.02.
5 # This code is part of distribution Mail-Box. Meta-POD processed with
6 # OODoc into POD and HTML manual-pages. See README.md
7 # Copyright Mark Overmeer. Licensed under the same terms as Perl itself.
8  
9 package Mail::Box::Net;
10 1 ▶use vars '$VERSION';
Subroutine BEGIN: called CC=1 SCAR=0.0
11 1 $VERSION = '3.009';
12  
13  
14 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
15 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
16  
17 1 ▶use base 'Mail::Box';
Subroutine BEGIN: called CC=1 SCAR=0.0
18  
19 1 ▶use Mail::Box::Net::Message;
Subroutine BEGIN: called CC=1 SCAR=0.0
20  
21 1 ▶use Mail::Message::Body::Lines;
Subroutine BEGIN: called CC=1 SCAR=0.0
22 1 ▶use Mail::Message::Body::File;
Subroutine BEGIN: called CC=1 SCAR=0.0
23 1 ▶use Mail::Message::Body::Delayed;
Subroutine BEGIN: called CC=1 SCAR=0.0
24 1 ▶use Mail::Message::Body::Multipart;
Subroutine BEGIN: called CC=1 SCAR=0.0
25  
26 1 ▶use Mail::Message::Head;
Subroutine BEGIN: called CC=1 SCAR=0.0
27 1 ▶use Mail::Message::Head::Delayed;
Subroutine BEGIN: called CC=1 SCAR=0.0
28  
29 1 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
30 1 ▶use File::Copy;
Subroutine BEGIN: called CC=1 SCAR=0.0
31 1 ▶use File::Spec;
Subroutine BEGIN: called CC=1 SCAR=0.0
32 1 ▶use File::Basename;
Subroutine BEGIN: called CC=1 SCAR=0.0
33  
34  
35 sub init($)
36 0 ▶{ my ($self, $args) = @_;
Subroutine init: not called CC=12 SCAR=50.5
Pod undocumented
37  
38 0 ▶ $args->{lock_type} ||= 'NONE';
Condition0%0/2
$args->{"lock_type"} ||= "NONE"
l!l
00
MC/DC0%0/1
$args->{"lock_type"} ||= "NONE"
$args->{"lock_type"}
Truth table0%0/2
A
A= $args->{"lock_type"}
Aresult
11
00
39 0 ▶ $args->{body_type} ||= 'Mail::Message::Body::Lines';
Condition0%0/2
$args->{"body_type"} ||= "Mail::Message::Body::Lines"
l!l
00
MC/DC0%0/1
$args->{"body_type"} ||= "Mail::Message::Body::Lines"
$args->{"body_type"}
Truth table0%0/2
A
A= $args->{"body_type"}
Aresult
11
00
40 0 ▶ $args->{trusted} ||= 0;
Condition0%0/2
$args->{"trusted"} ||= 0
l!l
00
MC/DC0%0/1
$args->{"trusted"} ||= 0
$args->{"trusted"}
Truth table0%0/2
A
A= $args->{"trusted"}
Aresult
11
00
41  
42 0 my ($scheme, $s, $port, $u, $pwd, $f);
43 0 ▶ if(my $d = $args->{folderdir})
Branch: 1 branch
BranchTrueFalseTotal
if (my $d = $args->{"folderdir"}) 0 0 0
44 { # cannot use URI, because some scheme's are fake
45 0 ($scheme, $u, $pwd, $s, $port, $f) = $d =~
46 m! ^ (\w+) \:// # scheme
47 (?: ( [^:\@/]+ ) # username
48 (?: \: ( [^\@/]+ ))? # password
49 \@ )?
50 ( [a-zA-Z0-9.-]+ )? # hostname
51 (?: \: ([0-9]+) )? # port
52 ( / .* )? # path
53 !x;
54 0 $args->{folderdir} =~ s!/$!!;
55 }
56  
57 0 ▶ $args->{folder} ||= $f || '/';
Condition0%0/5
$args->{"folder"} ||= $f || "/"
l!l&&r!l&&!r
000
$f || '/'
l!l
00
MC/DC0%0/2
$args->{"folder"} ||= $f || "/"
$args->{"folder"} $f
Truth table0%0/3
A ||= B
A= $args->{"folder"}B= $f
ABresult
1X1
011
000
58  
59 0 $self->SUPER::init($args);
60  
61 0 ▶ $self->{MBN_hostname} = $args->{server_name} || $s;
Condition0%0/3
$args->{'server_name'} || $s
l!l&&r!l&&!r
000
MC/DC0%0/2
$args->{'server_name'} || $s
$args->{'server_name'} $s
Truth table0%0/3
A || B
A= $args->{'server_name'}B= $s
ABresult
1X1
011
000
62 0 ▶ $self->{MBN_port} = $args->{server_port} || $port;
Condition0%0/3
$args->{'server_port'} || $port
l!l&&r!l&&!r
000
MC/DC0%0/2
$args->{'server_port'} || $port
$args->{'server_port'} $port
Truth table0%0/3
A || B
A= $args->{'server_port'}B= $port
ABresult
1X1
011
000
63 0 ▶ $self->{MBN_username} = $args->{username} || $u;
Condition0%0/3
$args->{'username'} || $u
l!l&&r!l&&!r
000
MC/DC0%0/2
$args->{'username'} || $u
$args->{'username'} $u
Truth table0%0/3
A || B
A= $args->{'username'}B= $u
ABresult
1X1
011
000
64 0 ▶ $self->{MBN_password} = $args->{password} || $pwd;
Condition0%0/3
$args->{'password'} || $pwd
l!l&&r!l&&!r
000
MC/DC0%0/2
$args->{'password'} || $pwd
$args->{'password'} $pwd
Truth table0%0/3
A || B
A= $args->{'password'}B= $pwd
ABresult
1X1
011
000
65  
66 $self->log(WARNING => "The term 'hostname' is confusing wrt folder. You probably need 'server_name'")
67 0 ▶ if exists $args->{hostname};
Branch: 1 branch
BranchTrueFalseTotal
if exists $args->{"hostname"} 0 0 0
68  
69 0 $self;
70 }
71  
72  
73 0 ▶sub create(@) {shift->notImplemented}
Subroutine create: not called CC=1 SCAR=6.9
Pod documented
74 sub organization() { 'REMOTE' }
75  
76 sub url()
77 0 ▶{ my $self = shift;
Subroutine url: not called CC=6 SCAR=37.4
Pod documented
78  
79 my ($user, $pass, $host, $port)
80 0 = @$self{ qw/MBN_username MBN_password MBN_hostname MBN_port/ };
81  
82 0 my $perm = '';
83 0 ▶ $perm = $user if defined $user;
Branch: 1 branch
BranchTrueFalseTotal
if defined $user 0 0 0
84 0 ▶ if(defined $pass)
Branch: 1 branch
BranchTrueFalseTotal
if (defined $pass) 0 0 0
85 0 { $pass =~ s/(\W)/sprintf "%%%02X", ord $1/ge;
86 0 $perm .= ':'.$pass;
87 }
88  
89 0 ▶ $perm .= '@' if length $perm;
Branch: 1 branch
BranchTrueFalseTotal
if length $perm 0 0 0
90  
91 0 my $loc = $host;
92 0 ▶ $loc .= ':'.$port if length $port;
Branch: 1 branch
BranchTrueFalseTotal
if length $port 0 0 0
93  
94 0 my $name = $self->name;
95 0 ▶ $loc .= '/'.$name if $name ne '/';
Branch: 1 branch
BranchTrueFalseTotal
if $name ne "/" 0 0 0
96
97 0 $self->type . '://' . $perm . $loc;
98 }
99  
100 1 1;
« Box/Thread/Manager.pm ↑ Summary Box/Thread/Node.pm »