Send/NNTP.pm

filter: Statementstmt 62.9% 17 / 27 Branchbran 8.3% 1 / 12 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 71.4% 5 / 7 Podpod 0.0% 0 / 2 totaltotal 47.9% 23 / 48 CC 7 SCAR 25.7
CC
7
Cov
46%
send
30.0
DESTROY
6.0
is_available
2.1
CRAP 13.1
« Send/SMTP.pm ↑ Summary Send/Qmail.pm »
1 package Email::Send::NNTP;
2 3 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3  
4 3 our $VERSION = '2.202';
5 3 $VERSION = eval $VERSION;
6  
7 3 ▶use vars qw[$NNTP];
Subroutine BEGIN: called CC=1 SCAR=0.0
8 3 ▶use Net::NNTP;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 3 ▶BEGIN {
Subroutine BEGIN: called CC=1 SCAR=0.0
10 3 local $Return::Value::NO_CLUCK = 1;
11 3 require Return::Value;
12 3 Return::Value->import;
13 }
14  
15 1 ▶sub is_available {
Subroutine is_available: called CC=2 SCAR=7.2
Pod undocumented
16 1 ▶ return eval { require Net::NNTP }
Branch: 1 branch
BranchTrueFalseTotal
eval { do { require Net::NNTP } } ? : 1 0 1
17 ? success
18 : failure $@;
19 }
20  
21 0 ▶sub send {
Subroutine send: not called CC=5 SCAR=34.0
Pod undocumented
22 0 my ($class, $message, @args) = @_;
23 0 eval { require Net::NNTP };
24 0 ▶ if ( @_ > 1 ) {
Branch: 1 branch
BranchTrueFalseTotal
if (@_ > 1) 0 0 0
25 0 ▶ $NNTP->quit if $NNTP;
Branch: 1 branch
BranchTrueFalseTotal
if $Email::Send::NNTP::NNTP 0 0 0
26 0 $NNTP = Net::NNTP->new(@args);
27 0 ▶ return failure unless $NNTP;
Branch: 1 branch
BranchTrueFalseTotal
unless $Email::Send::NNTP::NNTP 0 0 0
28 }
29 0 ▶ return failure unless $NNTP->post( $message->as_string );
Branch: 1 branch
BranchTrueFalseTotal
unless $Email::Send::NNTP::NNTP->post($message->as_string) 0 0 0
30 0 return success;
31 }
32  
33 0 ▶sub DESTROY {
Subroutine DESTROY: not called CC=2 SCAR=17.9
34 0 ▶ $NNTP->quit if $NNTP;
Branch: 1 branch
BranchTrueFalseTotal
if $Email::Send::NNTP::NNTP 0 0 0
35 }
36  
37 3 1;
38  
39 __END__
« Send/SMTP.pm ↑ Summary Send/Qmail.pm »