| 1 | 1 | ▶ | use strict; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 2 | 1 | ▶ | use warnings; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 3 | package Email::Folder::POP3; | ||||||||||||||||||||
| 4 | { | ||||||||||||||||||||
| 5 | 1 | $Email::Folder::POP3::VERSION = '1.015'; | |||||||||||||||||||
| 6 | } | ||||||||||||||||||||
| 7 | # ABSTRACT: Email::Folder Access to POP3 Folders | ||||||||||||||||||||
| 8 | |||||||||||||||||||||
| 9 | 1 | ▶ | our $POP3 ||= 'Net::POP3'; | ||||||||||||||||||
|
Condition50%1/2
our $POP3 ||= "Net::POP3"
MC/DC0%0/1
our $POP3 ||= "Net::POP3"
our $POP3
Truth table50%1/2
A
A= our $POP3
| |||||||||||||||||||||
| 10 | |||||||||||||||||||||
| 11 | 1 | ▶ | use parent qw[Email::Folder::Reader]; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 12 | 1 | ▶ | use Net::POP3; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 13 | 1 | ▶ | use URI; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 14 | |||||||||||||||||||||
| 15 | 0 | ▶ | sub _uri { | ||||||||||||||||||
|
Subroutine
_uri: not called CC=2 SCAR=17.9
| |||||||||||||||||||||
| 16 | 0 | my $self = shift; | |||||||||||||||||||
| 17 | 0 | ▶ | return $self->{_uri} ||= URI->new($self->{_file}); | ||||||||||||||||||
|
Condition0%0/3
$self->{"_uri"} ||= "URI"->new($self->{"_file"})
MC/DC0%0/2
$self->{"_uri"} ||= "URI"->new($self->{"_file"})
$self->{"_uri"}
"URI"->new($self->{"_file"})
Truth table0%0/3
A ||= B
A= $self->{"_uri"}B= "URI"->new($self->{"_file"})
| |||||||||||||||||||||
| 18 | } | ||||||||||||||||||||
| 19 | |||||||||||||||||||||
| 20 | 0 | ▶ | sub _server { | ||||||||||||||||||
|
Subroutine
_server: not called CC=6 SCAR=37.4
| |||||||||||||||||||||
| 21 | 0 | my $self = shift; | |||||||||||||||||||
| 22 | 0 | ▶ | return $self->{_server} if $self->{_server}; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 23 | |||||||||||||||||||||
| 24 | 0 | my $uri = $self->_uri; | |||||||||||||||||||
| 25 | 0 | my $host = $uri->host; | |||||||||||||||||||
| 26 | 0 | ▶ | my $port = $uri->port || 110; | ||||||||||||||||||
|
Condition0%0/2
$uri->port || 110
MC/DC0%0/1
$uri->port || 110
$uri->port
Truth table0%0/2
A
A= $uri->port
| |||||||||||||||||||||
| 27 | 0 | ▶ | my $server = $POP3->new($host, Port => $port, Timeout => 60) | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 28 | or die("Net::POP3->new('$host', Port => $port, Timeout => 60): $!"); | ||||||||||||||||||||
| 29 | |||||||||||||||||||||
| 30 | 0 | my ($user, $pass) = @{$self}{qw[username password]}; | |||||||||||||||||||
| 31 | 0 | ▶ | ($user, $pass) = split ':', $uri->userinfo, 2 unless $user; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 32 | |||||||||||||||||||||
| 33 | 0 | ▶ | $server->login($user, $pass) if $user; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 34 | |||||||||||||||||||||
| 35 | 0 | $self->{_next} = 1; | |||||||||||||||||||
| 36 | 0 | return $self->{_server} = $server; | |||||||||||||||||||
| 37 | } | ||||||||||||||||||||
| 38 | |||||||||||||||||||||
| 39 | 0 | ▶ | sub next_message { | ||||||||||||||||||
|
Subroutine
next_message: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||||||||||
| 40 | 0 | my $self = shift; | |||||||||||||||||||
| 41 | 0 | my $message = $self->_server->get($self->{_next}); | |||||||||||||||||||
| 42 | 0 | ▶ | if ( $message ) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 43 | 0 | ++$self->{_next}; | |||||||||||||||||||
| 44 | 0 | return join '', @{$message}; | |||||||||||||||||||
| 45 | } | ||||||||||||||||||||
| 46 | 0 | $self->{_next} = 1; | |||||||||||||||||||
| 47 | 0 | return; | |||||||||||||||||||
| 48 | } | ||||||||||||||||||||
| 49 | |||||||||||||||||||||
| 50 | 1 | 1; | |||||||||||||||||||
| 51 | |||||||||||||||||||||
| 52 | __END__ | ||||||||||||||||||||