NNTP.pm

filter: Statementstmt 32.1% 117 / 364 Branchbran 10.9% 27 / 246 Conditioncond 7.5% 13 / 173 MC/DCmcdc 0.0% 0 / 102 Subroutinesub 22.5% 21 / 93 Podpod 100% 44 / 44 totaltotal 21.7% 222 / 1022 CC 183 SCAR 35.6
CC
183
Cov
20%
group
182.0
newnews
90.0
article
72.0
CRAP 35.3
« Netrc.pm ↑ Summary FTP/I.pm »
1 # Net::NNTP.pm
2 #
3 # Copyright (C) 1995-1997 Graham Barr. All rights reserved.
4 # Copyright (C) 2013-2016, 2020 Steve Hay. All rights reserved.
5 # This module is free software; you can redistribute it and/or modify it under
6 # the same terms as Perl itself, i.e. under the terms of either the GNU General
7 # Public License or the Artistic License, as specified in the F<LICENCE> file.
8  
9 package Net::NNTP;
10  
11 6 ▶use 5.008001;
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 6 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
14 6 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
15  
16 6 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
17 6 ▶use IO::Socket;
Subroutine BEGIN: called CC=1 SCAR=0.0
18 6 ▶use Net::Cmd;
Subroutine BEGIN: called CC=1 SCAR=0.0
19 6 ▶use Net::Config;
Subroutine BEGIN: called CC=1 SCAR=0.0
20 6 ▶use Time::Local;
Subroutine BEGIN: called CC=1 SCAR=0.0
21  
22 6 our $VERSION = "3.16";
23  
24 # Code for detecting if we can use SSL
25 6 ▶my $ssl_class = eval {
Condition50%1/2
eval { do { require IO::Socket::SSL; BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x51\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55"} 'IO::Socket::SSL'->VERSION(2.007) } } && 'IO::Socket::SSL'
!ll
06
MC/DC0%0/1
eval { do { require IO::Socket::SSL; BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x51\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55"} 'IO::Socket::SSL'->VERSION(2.007) } } && 'IO::Socket::SSL'
eval { do { require IO::Socket::SSL; BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x51\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55"} 'IO::Socket::SSL'->VERSION(2.007) } }
Truth table50%1/2
A
A= eval { do { require IO::Socket::SSL; BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x51\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55"} 'IO::Socket::SSL'->VERSION(2.007) } }
Aresult
00
11
26 6 require IO::Socket::SSL;
27 # first version with default CA on most platforms
28 6 ▶ no warnings 'numeric';
Subroutine BEGIN: called CC=1 SCAR=0.0
29 6 IO::Socket::SSL->VERSION(2.007);
30 } && 'IO::Socket::SSL';
31  
32 6 ▶my $nossl_warn = !$ssl_class &&
Condition50%1/2
!$ssl_class && 'To use SSL please install IO::Socket::SSL with version>=2.007'
!ll
60
MC/DC0%0/1
!$ssl_class && 'To use SSL please install IO::Socket::SSL with version>=2.007'
!$ssl_class
Truth table50%1/2
not(A)
A= !$ssl_class
Aresult
00
11
33 'To use SSL please install IO::Socket::SSL with version>=2.007';
34  
35 # Code for detecting if we can use IPv6
36 6 my $family_key = 'Domain';
37 my $inet6_class = eval {
38 6 require IO::Socket::IP;
39 6 ▶ no warnings 'numeric';
Subroutine BEGIN: called CC=1 SCAR=0.0
40 6 ▶ IO::Socket::IP->VERSION(0.25) || die;
Branch: 1 branch
BranchTrueFalseTotal
"IO::Socket::IP"->VERSION("0.25") or die 6 0 6
41 6 ▶ $family_key = 'Family';
Condition0%0/2
eval { do { use warnings; require IO::Socket::INET6; BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x51\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55"} "IO::Socket::INET6"->VERSION("2.62") } } and "IO::Socket::INET6"
!ll
00
MC/DC0%0/1
eval { do { use warnings; require IO::Socket::INET6; BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x51\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55"} "IO::Socket::INET6"->VERSION("2.62") } } and "IO::Socket::INET6"
eval { do { use warnings; require IO::Socket::INET6; BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x51\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55"} "IO::Socket::INET6"->VERSION("2.62") } }
Truth table0%0/2
A
A= eval { do { use warnings; require IO::Socket::INET6; BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x51\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55"} "IO::Socket::INET6"->VERSION("2.62") } }
Aresult
00
11
42 6 ▶} && 'IO::Socket::IP' || eval {
Condition40%2/5
eval { do { require IO::Socket::IP; BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x51\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55"} 'IO::Socket::IP'->VERSION(0.25) or die; $family_key = 'Family' } } && 'IO::Socket::IP' || eval { do { require IO::Socket::INET6; BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x51\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55"} 'IO::Socket::INET6'->VERSION(2.62) } } && 'IO::Socket::INET6'
l!l&&r!l&&!r
600
eval { do { require IO::Socket::IP; BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x51\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55"} "IO::Socket::IP"->VERSION("0.25") or die; $family_key = "Family" } } and "IO::Socket::IP"
!ll
06
MC/DC0%0/2
eval { do { require IO::Socket::IP; BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x51\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55"} 'IO::Socket::IP'->VERSION(0.25) or die; $family_key = 'Family' } } && 'IO::Socket::IP' || eval { do { require IO::Socket::INET6; BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x51\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55"} 'IO::Socket::INET6'->VERSION(2.62) } } && 'IO::Socket::INET6'
eval { do { require IO::Socket::IP; BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x51\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55"} "IO::Socket::IP"->VERSION("0.25") or die; $family_key = "Family" } } eval { do { require IO::Socket::INET6; BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x51\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55"} 'IO::Socket::INET6'->VERSION(2.62) } } && 'IO::Socket::INET6'
Truth table33%1/3
A || B
A= eval { do { require IO::Socket::IP; BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x51\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55"} "IO::Socket::IP"->VERSION("0.25") or die; $family_key = "Family" } }B= eval { do { require IO::Socket::INET6; BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x51\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55"} 'IO::Socket::INET6'->VERSION(2.62) } } && 'IO::Socket::INET6'
ABresult
1X1
011
000
43 0 require IO::Socket::INET6;
44 6 ▶ no warnings 'numeric';
Subroutine BEGIN: called CC=1 SCAR=0.0
45 0 IO::Socket::INET6->VERSION(2.62);
46 } && 'IO::Socket::INET6';
47  
48  
49 3 ▶sub can_ssl { $ssl_class };
Subroutine can_ssl: called CC=1 SCAR=0.0
Pod documented
50 1 ▶sub can_inet6 { $inet6_class };
Subroutine can_inet6: called CC=1 SCAR=0.0
Pod documented
51  
52 6 ▶our @ISA = ('Net::Cmd', $inet6_class || 'IO::Socket::INET');
Condition50%1/2
$inet6_class || 'IO::Socket::INET'
l!l
60
MC/DC0%0/1
$inet6_class || 'IO::Socket::INET'
$inet6_class
Truth table50%1/2
A
A= $inet6_class
Aresult
11
00
53  
54  
55 3 ▶sub new {
Subroutine new: called CC=27 SCAR=39.6
Pod documented
56 3 my $self = shift;
57 3 ▶ my $type = ref($self) || $self;
Condition33%1/3
ref $self || $self
l!l&&r!l&&!r
030
MC/DC0%0/2
ref $self || $self
ref $self $self
Truth table33%1/3
A || B
A= ref $selfB= $self
ABresult
1X1
011
000
58 3 my ($host, %arg);
59 3 ▶ if (@_ % 2) {
Branch: 1 branch
BranchTrueFalseTotal
if (@_ % 2) { } 0 3 3
60 0 $host = shift;
61 0 %arg = @_;
62 }
63 else {
64 3 %arg = @_;
65 3 $host = delete $arg{Host};
66 }
67 3 my $obj;
68  
69 3 ▶ $host ||= $ENV{NNTPSERVER} || $ENV{NEWSHOST};
Condition16%1/6
$host ||= $ENV{"NNTPSERVER"} || $ENV{"NEWSHOST"}
l!l&&r!l&&!r
300
$ENV{'NNTPSERVER'} || $ENV{'NEWSHOST'}
l!l&&r!l&&!r
000
MC/DC0%0/3
$host ||= $ENV{"NNTPSERVER"} || $ENV{"NEWSHOST"}
$host $ENV{'NNTPSERVER'} $ENV{'NEWSHOST'}
Truth table0%0/4
A ||= B || C
A= $hostB= $ENV{'NNTPSERVER'}C= $ENV{'NEWSHOST'}
ABCresult
1XX1
01X1
0011
0000
70  
71 3 ▶ my $hosts = defined $host ? [$host] : $NetConfig{nntp_hosts};
Branch: 1 branch
BranchTrueFalseTotal
defined $host ? : 3 0 3
72  
73 0 @{$hosts} = qw(news)
74 3 ▶ unless @{$hosts};
Branch: 1 branch
BranchTrueFalseTotal
unless @{$hosts;} 0 3 3
75  
76 3 my %connect = ( Proto => 'tcp');
77  
78 3 ▶ if ($arg{SSL}) {
Branch: 1 branch
BranchTrueFalseTotal
if ($arg{"SSL"}) 2 1 3
79 # SSL from start
80 2 ▶ die $nossl_warn if ! $ssl_class;
Branch: 1 branch
BranchTrueFalseTotal
unless $ssl_class 0 2 2
81 2 ▶ $arg{Port} ||= 563;
Condition50%1/2
$arg{"Port"} ||= 563
l!l
20
MC/DC0%0/1
$arg{"Port"} ||= 563
$arg{"Port"}
Truth table50%1/2
A
A= $arg{"Port"}
Aresult
11
00
82 2 $connect{$_} = $arg{$_} for(grep { m{^SSL_} } keys %arg);
83 }
84  
85 3 foreach my $o (qw(LocalAddr LocalPort Timeout)) {
86 9 ▶ $connect{$o} = $arg{$o} if exists $arg{$o};
Branch: 1 branch
BranchTrueFalseTotal
if exists $arg{$o} 0 9 9
87 }
88 3 ▶ $connect{$family_key} = $arg{Domain} || $arg{Family};
Condition33%1/3
$arg{'Domain'} || $arg{'Family'}
l!l&&r!l&&!r
003
MC/DC0%0/2
$arg{'Domain'} || $arg{'Family'}
$arg{'Domain'} $arg{'Family'}
Truth table33%1/3
A || B
A= $arg{'Domain'}B= $arg{'Family'}
ABresult
1X1
011
000
89 3 ▶ $connect{Timeout} = 120 unless defined $connect{Timeout};
Branch: 1 branch
BranchTrueFalseTotal
unless defined $connect{"Timeout"} 3 0 3
90 3 ▶ $connect{PeerPort} = $arg{Port} || 'nntp(119)';
Condition50%1/2
$arg{'Port'} || 'nntp(119)'
l!l
30
MC/DC0%0/1
$arg{'Port'} || 'nntp(119)'
$arg{'Port'}
Truth table50%1/2
A
A= $arg{'Port'}
Aresult
11
00
91 3 foreach my $h (@{$hosts}) {
92 3 $connect{PeerAddr} = $h;
93 3 ▶ $obj = $type->SUPER::new(%connect) or next;
Branch: 1 branch
BranchTrueFalseTotal
$obj = $type->SUPER::new(%connect) or next 3 0 3
94 3 ${*$obj}{'net_nntp_host'} = $h;
95 3 ${*$obj}{'net_nntp_arg'} = \%arg;
96 3 ▶ if ($arg{SSL}) {
Branch: 1 branch
BranchTrueFalseTotal
if ($arg{"SSL"}) 2 1 3
97 2 ▶ Net::NNTP::_SSL->start_SSL($obj,%arg) or next;
Branch: 1 branch
BranchTrueFalseTotal
"Net::NNTP::_SSL"->start_SSL($obj, %arg) or next 2 0 2
98 }
99 }
100  
101 return
102 3 ▶ unless defined $obj;
Branch: 1 branch
BranchTrueFalseTotal
unless defined $obj 0 3 3
103  
104 3 $obj->autoflush(1);
105 3 ▶ $obj->debug(exists $arg{Debug} ? $arg{Debug} : undef);
Branch: 1 branch
BranchTrueFalseTotal
exists $arg{'Debug'} ? : 3 0 3
106  
107 3 ▶ unless ($obj->response() == CMD_OK) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($obj->response == 2) 0 3 3
108 0 $obj->close;
109 0 return;
110 }
111  
112 3 my $c = $obj->code;
113 3 my @m = $obj->message;
114  
115 3 ▶ unless (exists $arg{Reader} && $arg{Reader} == 0) {
Branch: 1 branch
BranchTrueFalseTotal
unless (exists $arg{"Reader"} and $arg{"Reader"} == 0) 3 0 3
Condition33%1/3
exists $arg{"Reader"} and $arg{"Reader"} == 0
!ll&&!rl&&r
300
MC/DC0%0/2
exists $arg{"Reader"} and $arg{"Reader"} == 0
exists $arg{"Reader"} $arg{"Reader"} == 0
Truth table33%1/3
A and B
A= exists $arg{"Reader"}B= $arg{"Reader"} == 0
ABresult
0X0
100
111
116  
117 # if server is INN and we have transfer rights the we are currently
118 # talking to innd not nnrpd
119 3 ▶ if ($obj->reader) {
Branch: 1 branch
BranchTrueFalseTotal
if ($obj->reader) { } 3 0 3
120  
121 # If reader succeeds the we need to consider this code to determine postok
122 3 $c = $obj->code;
123 }
124 else {
125  
126 # I want to ignore this failure, so restore the previous status.
127 0 $obj->set_status($c, \@m);
128 }
129 }
130  
131 3 ▶ ${*$obj}{'net_nntp_post'} = $c == 200 ? 1 : 0;
Branch: 1 branch
BranchTrueFalseTotal
$c == 200 ? : 0 3 3
132  
133 3 $obj;
134 }
135  
136  
137 0 ▶sub host {
Subroutine host: not called CC=1 SCAR=6.9
Pod documented
138 0 my $me = shift;
139 0 ${*$me}{'net_nntp_host'};
140 }
141  
142  
143 0 ▶sub debug_text {
Subroutine debug_text: not called CC=5 SCAR=34.0
Pod documented
144 0 my $nntp = shift;
145 0 my $inout = shift;
146 0 my $text = shift;
147  
148 0 ▶ if ( (ref($nntp) and $nntp->code == 350 and $text =~ /^(\S+)/)
Branch: 1 branch
BranchTrueFalseTotal
if (ref $nntp and $nntp->code == 350 and $text =~ /^(\S+)/ or $text =~ /^(authinfo\s+pass)/io) 0 0 0
Condition0%0/9
ref $nntp and $nntp->code == 350 and $text =~ /^(\S+)/ or $text =~ /^(authinfo\s+pass)/io
l!l&&r!l&&!r
000
ref $nntp and $nntp->code == 350 and $text =~ /^(\S+)/
!ll&&!rl&&r
000
ref $nntp and $nntp->code == 350
!ll&&!rl&&r
000
MC/DC0%0/4
ref $nntp and $nntp->code == 350 and $text =~ /^(\S+)/ or $text =~ /^(authinfo\s+pass)/io
ref $nntp $nntp->code == 350 $text =~ /^(\S+)/ $text =~ /^(authinfo\s+pass)/io
Truth table0%0/7
A and B and C or D
A= ref $nntpB= $nntp->code == 350C= $text =~ /^(\S+)/D= $text =~ /^(authinfo\s+pass)/io
ABCDresult
111X1
0XX11
10X11
11011
0XX00
10X00
11000
149 || ($text =~ /^(authinfo\s+pass)/io))
150 {
151 0 $text = "$1 ....\n";
152 }
153  
154 0 $text;
155 }
156  
157  
158 0 ▶sub postok {
Subroutine postok: not called CC=3 SCAR=24.8
Pod documented
159 0 ▶ @_ == 1 or croak 'usage: $nntp->postok()';
Branch: 1 branch
BranchTrueFalseTotal
@_ == 1 or croak("usage: \$nntp->postok()") 0 0 0
160 0 my $nntp = shift;
161 0 ▶ ${*$nntp}{'net_nntp_post'} || 0;
Branch: 1 branch
BranchTrueFalseTotal
do { *$nntp }->{"net_nntp_post"} or 0 0 0 0
162 }
163  
164  
165 1 ▶sub starttls {
Subroutine starttls: called CC=4 SCAR=14.3
Pod documented
166 1 my $self = shift;
167 1 ▶ $ssl_class or die $nossl_warn;
Branch: 1 branch
BranchTrueFalseTotal
$ssl_class or die $nossl_warn 1 0 1
168 1 ▶ $self->_STARTTLS or return;
Branch: 1 branch
BranchTrueFalseTotal
$self->_STARTTLS or return 1 0 1
169 Net::NNTP::_SSL->start_SSL($self,
170 1 ▶ %{ ${*$self}{'net_nntp_arg'} }, # (ssl) args given in new
Branch: 1 branch
BranchTrueFalseTotal
"Net::NNTP::_SSL"->start_SSL($self, %{${*$self;}{"net_nntp_arg"};}, @_) or return 1 0 1
171 @_ # more (ssl) args
172 ) or return;
173 1 return 1;
174 }
175  
176  
177 0 ▶sub article {
Subroutine article: not called CC=8 SCAR=42.8
Pod documented
178 0 ▶ @_ >= 1 && @_ <= 3 or croak 'usage: $nntp->article([{$msgid|$msgnum}[, $fh]])';
Branch: 1 branch
BranchTrueFalseTotal
@_ >= 1 and @_ <= 3 or croak("usage: \$nntp->article([{\$msgid|\$msgnum}[, \$fh]])") 0 0 0
Condition0%0/3
@_ >= 1 and @_ <= 3
!ll&&!rl&&r
000
MC/DC0%0/2
@_ >= 1 and @_ <= 3
@_ >= 1 @_ <= 3
Truth table0%0/3
A and B
A= @_ >= 1B= @_ <= 3
ABresult
0X0
100
111
179 0 my $nntp = shift;
180 0 my @fh;
181  
182 0 ▶ @fh = (pop) if @_ == 2 || (@_ && (ref($_[0]) || ref(\$_[0]) eq 'GLOB'));
Branch: 1 branch
BranchTrueFalseTotal
if @_ == 2 or @_ and ref $_[0] || ref \$_[0] eq "GLOB" 0 0 0
Condition0%0/9
@_ == 2 or @_ and ref $_[0] || ref \$_[0] eq "GLOB"
l!l&&r!l&&!r
000
@_ and ref $_[0] || ref \$_[0] eq "GLOB"
!ll&&!rl&&r
000
ref $_[0] or ref \$_[0] eq "GLOB"
l!l&&r!l&&!r
000
MC/DC0%0/4
@_ == 2 or @_ and ref $_[0] || ref \$_[0] eq "GLOB"
@_ == 2 @_ ref $_[0] ref \$_[0] eq "GLOB"
Truth table0%0/5
A or B and C or D
A= @_ == 2B= @_C= ref $_[0]D= ref \$_[0] eq "GLOB"
ABCDresult
1XXX1
011X1
01011
00XX0
01000
183  
184 0 ▶ $nntp->_ARTICLE(@_)
Branch: 1 branch
BranchTrueFalseTotal
$nntp->_ARTICLE(@_) ? : 0 0 0
185 ? $nntp->read_until_dot(@fh)
186 : undef;
187 }
188  
189  
190 0 ▶sub articlefh {
Subroutine articlefh: not called CC=4 SCAR=30.0
Pod documented
191 0 ▶ @_ >= 1 && @_ <= 2 or croak 'usage: $nntp->articlefh([{$msgid|$msgnum}])';
Branch: 1 branch
BranchTrueFalseTotal
@_ >= 1 and @_ <= 2 or croak("usage: \$nntp->articlefh([{\$msgid|\$msgnum}])") 0 0 0
Condition0%0/3
@_ >= 1 and @_ <= 2
!ll&&!rl&&r
000
MC/DC0%0/2
@_ >= 1 and @_ <= 2
@_ >= 1 @_ <= 2
Truth table0%0/3
A and B
A= @_ >= 1B= @_ <= 2
ABresult
0X0
100
111
192 0 my $nntp = shift;
193  
194 0 ▶ return unless $nntp->_ARTICLE(@_);
Branch: 1 branch
BranchTrueFalseTotal
unless $nntp->_ARTICLE(@_) 0 0 0
195 0 return $nntp->tied_fh;
196 }
197  
198  
199 0 ▶sub authinfo {
Subroutine authinfo: not called CC=3 SCAR=24.8
Pod documented
200 0 ▶ @_ == 3 or croak 'usage: $nntp->authinfo($user, $pass)';
Branch: 1 branch
BranchTrueFalseTotal
@_ == 3 or croak("usage: \$nntp->authinfo(\$user, \$pass)") 0 0 0
201 0 my ($nntp, $user, $pass) = @_;
202  
203 0 ▶ $nntp->_AUTHINFO("USER", $user) == CMD_MORE
Branch: 1 branch
BranchTrueFalseTotal
$nntp->_AUTHINFO("USER", $user) == 3 and $nntp->_AUTHINFO("PASS", $pass) == 2 0 0 0
204 && $nntp->_AUTHINFO("PASS", $pass) == CMD_OK;
205 }
206  
207  
208 0 ▶sub authinfo_simple {
Subroutine authinfo_simple: not called CC=3 SCAR=24.8
Pod documented
209 0 ▶ @_ == 3 or croak 'usage: $nntp->authinfo_simple($user, $pass)';
Branch: 1 branch
BranchTrueFalseTotal
@_ == 3 or croak("usage: \$nntp->authinfo_simple(\$user, \$pass)") 0 0 0
210 0 my ($nntp, $user, $pass) = @_;
211  
212 0 ▶ $nntp->_AUTHINFO('SIMPLE') == CMD_MORE
Branch: 1 branch
BranchTrueFalseTotal
$nntp->_AUTHINFO("SIMPLE") == 3 and $nntp->command($user, $pass)->response == 2 0 0 0
213 && $nntp->command($user, $pass)->response == CMD_OK;
214 }
215  
216  
217 0 ▶sub body {
Subroutine body: not called CC=8 SCAR=42.8
Pod documented
218 0 ▶ @_ >= 1 && @_ <= 3 or croak 'usage: $nntp->body([{$msgid|$msgnum}[, $fh]])';
Branch: 1 branch
BranchTrueFalseTotal
@_ >= 1 and @_ <= 3 or croak("usage: \$nntp->body([{\$msgid|\$msgnum}[, \$fh]])") 0 0 0
Condition0%0/3
@_ >= 1 and @_ <= 3
!ll&&!rl&&r
000
MC/DC0%0/2
@_ >= 1 and @_ <= 3
@_ >= 1 @_ <= 3
Truth table0%0/3
A and B
A= @_ >= 1B= @_ <= 3
ABresult
0X0
100
111
219 0 my $nntp = shift;
220 0 my @fh;
221  
222 0 ▶ @fh = (pop) if @_ == 2 || (@_ && ref($_[0]) || ref(\$_[0]) eq 'GLOB');
Branch: 1 branch
BranchTrueFalseTotal
if @_ == 2 or (@_ and ref $_[0] or ref \$_[0] eq "GLOB") 0 0 0
Condition0%0/9
@_ == 2 or (@_ and ref $_[0] or ref \$_[0] eq "GLOB")
l!l&&r!l&&!r
000
@_ and ref $_[0] or ref \$_[0] eq "GLOB"
l!l&&r!l&&!r
000
@_ and ref $_[0]
!ll&&!rl&&r
000
MC/DC0%0/4
@_ == 2 or (@_ and ref $_[0] or ref \$_[0] eq "GLOB")
@_ == 2 @_ ref $_[0] ref \$_[0] eq "GLOB"
Truth table0%0/6
A or B and C or D
A= @_ == 2B= @_C= ref $_[0]D= ref \$_[0] eq "GLOB"
ABCDresult
1XXX1
011X1
00X11
01011
00X00
01000
223  
224 0 ▶ $nntp->_BODY(@_)
Branch: 1 branch
BranchTrueFalseTotal
$nntp->_BODY(@_) ? : 0 0 0
225 ? $nntp->read_until_dot(@fh)
226 : undef;
227 }
228  
229  
230 0 ▶sub bodyfh {
Subroutine bodyfh: not called CC=4 SCAR=30.0
Pod documented
231 0 ▶ @_ >= 1 && @_ <= 2 or croak 'usage: $nntp->bodyfh([{$msgid|$msgnum}])';
Branch: 1 branch
BranchTrueFalseTotal
@_ >= 1 and @_ <= 2 or croak("usage: \$nntp->bodyfh([{\$msgid|\$msgnum}])") 0 0 0
Condition0%0/3
@_ >= 1 and @_ <= 2
!ll&&!rl&&r
000
MC/DC0%0/2
@_ >= 1 and @_ <= 2
@_ >= 1 @_ <= 2
Truth table0%0/3
A and B
A= @_ >= 1B= @_ <= 2
ABresult
0X0
100
111
232 0 my $nntp = shift;
233 0 ▶ return unless $nntp->_BODY(@_);
Branch: 1 branch
BranchTrueFalseTotal
unless $nntp->_BODY(@_) 0 0 0
234 0 return $nntp->tied_fh;
235 }
236  
237  
238 0 ▶sub head {
Subroutine head: not called CC=8 SCAR=42.8
Pod documented
239 0 ▶ @_ >= 1 && @_ <= 3 or croak 'usage: $nntp->head([{$msgid|$msgnum}[, $fh]])';
Branch: 1 branch
BranchTrueFalseTotal
@_ >= 1 and @_ <= 3 or croak("usage: \$nntp->head([{\$msgid|\$msgnum}[, \$fh]])") 0 0 0
Condition0%0/3
@_ >= 1 and @_ <= 3
!ll&&!rl&&r
000
MC/DC0%0/2
@_ >= 1 and @_ <= 3
@_ >= 1 @_ <= 3
Truth table0%0/3
A and B
A= @_ >= 1B= @_ <= 3
ABresult
0X0
100
111
240 0 my $nntp = shift;
241 0 my @fh;
242  
243 0 ▶ @fh = (pop) if @_ == 2 || (@_ && ref($_[0]) || ref(\$_[0]) eq 'GLOB');
Branch: 1 branch
BranchTrueFalseTotal
if @_ == 2 or (@_ and ref $_[0] or ref \$_[0] eq "GLOB") 0 0 0
Condition0%0/9
@_ == 2 or (@_ and ref $_[0] or ref \$_[0] eq "GLOB")
l!l&&r!l&&!r
000
@_ and ref $_[0] or ref \$_[0] eq "GLOB"
l!l&&r!l&&!r
000
@_ and ref $_[0]
!ll&&!rl&&r
000
MC/DC0%0/4
@_ == 2 or (@_ and ref $_[0] or ref \$_[0] eq "GLOB")
@_ == 2 @_ ref $_[0] ref \$_[0] eq "GLOB"
Truth table0%0/6
A or B and C or D
A= @_ == 2B= @_C= ref $_[0]D= ref \$_[0] eq "GLOB"
ABCDresult
1XXX1
011X1
00X11
01011
00X00
01000
244  
245 0 ▶ $nntp->_HEAD(@_)
Branch: 1 branch
BranchTrueFalseTotal
$nntp->_HEAD(@_) ? : 0 0 0
246 ? $nntp->read_until_dot(@fh)
247 : undef;
248 }
249  
250  
251 0 ▶sub headfh {
Subroutine headfh: not called CC=4 SCAR=30.0
Pod documented
252 0 ▶ @_ >= 1 && @_ <= 2 or croak 'usage: $nntp->headfh([{$msgid|$msgnum}])';
Branch: 1 branch
BranchTrueFalseTotal
@_ >= 1 and @_ <= 2 or croak("usage: \$nntp->headfh([{\$msgid|\$msgnum}])") 0 0 0
Condition0%0/3
@_ >= 1 and @_ <= 2
!ll&&!rl&&r
000
MC/DC0%0/2
@_ >= 1 and @_ <= 2
@_ >= 1 @_ <= 2
Truth table0%0/3
A and B
A= @_ >= 1B= @_ <= 2
ABresult
0X0
100
111
253 0 my $nntp = shift;
254 0 ▶ return unless $nntp->_HEAD(@_);
Branch: 1 branch
BranchTrueFalseTotal
unless $nntp->_HEAD(@_) 0 0 0
255 0 return $nntp->tied_fh;
256 }
257  
258  
259 0 ▶sub nntpstat {
Subroutine nntpstat: not called CC=5 SCAR=34.0
Pod documented
260 0 ▶ @_ == 1 || @_ == 2 or croak 'usage: $nntp->nntpstat([{$msgid|$msgnum}])';
Branch: 1 branch
BranchTrueFalseTotal
@_ == 1 or @_ == 2 or croak("usage: \$nntp->nntpstat([{\$msgid|\$msgnum}])") 0 0 0
Condition0%0/3
@_ == 1 or @_ == 2
l!l&&r!l&&!r
000
MC/DC0%0/2
@_ == 1 or @_ == 2
@_ == 1 @_ == 2
Truth table0%0/3
A or B
A= @_ == 1B= @_ == 2
ABresult
1X1
011
000
261 0 my $nntp = shift;
262  
263 0 ▶ $nntp->_STAT(@_) && $nntp->message =~ /(<[^>]+>)/o
Branch: 1 branch
BranchTrueFalseTotal
$nntp->_STAT(@_) && $nntp->message =~ /(<[^>]+>)/o ? : 0 0 0
Condition0%0/3
$nntp->_STAT(@_) and $nntp->message =~ /(<[^>]+>)/o
!ll&&!rl&&r
000
MC/DC0%0/2
$nntp->_STAT(@_) and $nntp->message =~ /(<[^>]+>)/o
$nntp->_STAT(@_) $nntp->message =~ /(<[^>]+>)/o
Truth table0%0/3
A and B
A= $nntp->_STAT(@_)B= $nntp->message =~ /(<[^>]+>)/o
ABresult
0X0
100
111
264 ? $1
265 : undef;
266 }
267  
268  
269 0 ▶sub group {
Subroutine group: not called CC=13 SCAR=52.0
Pod documented
270 0 ▶ @_ == 1 || @_ == 2 or croak 'usage: $nntp->group([$group])';
Branch: 1 branch
BranchTrueFalseTotal
@_ == 1 or @_ == 2 or croak("usage: \$nntp->group([\$group])") 0 0 0
Condition0%0/3
@_ == 1 or @_ == 2
l!l&&r!l&&!r
000
MC/DC0%0/2
@_ == 1 or @_ == 2
@_ == 1 @_ == 2
Truth table0%0/3
A or B
A= @_ == 1B= @_ == 2
ABresult
1X1
011
000
271 0 my $nntp = shift;
272 0 my $grp = ${*$nntp}{'net_nntp_group'};
273  
274 0 ▶ return $grp
Branch: 1 branch
BranchTrueFalseTotal
unless @_ or wantarray 0 0 0
Condition0%0/3
@_ or wantarray
l!l&&r!l&&!r
000
MC/DC0%0/2
@_ or wantarray
@_ wantarray
Truth table0%0/3
A or B
A= @_B= wantarray
ABresult
1X1
011
000
275 unless (@_ || wantarray);
276  
277 0 my $newgrp = shift;
278  
279 0 ▶ $newgrp = (defined($grp) and length($grp)) ? $grp : ""
Branch: 2 branches
BranchTrueFalseTotal
unless defined $newgrp and length $newgrp 0 0 0
defined $grp && length $grp ? : 0 0 0
Condition0%0/6
defined $newgrp and length $newgrp
!ll&&!rl&&r
000
defined $grp and length $grp
!ll&&!rl&&r
000
MC/DC0%0/2
defined $newgrp and length $newgrp
defined $newgrp length $newgrp
MC/DC0%0/2
defined $grp and length $grp
defined $grp length $grp
Truth table0%0/3
A and B
A= defined $newgrpB= length $newgrp
ABresult
0X0
100
111
Truth table0%0/3
A and B
A= defined $grpB= length $grp
ABresult
0X0
100
111
280 unless defined($newgrp) and length($newgrp);
281  
282 return
283 0 ▶ unless $nntp->_GROUP($newgrp) and $nntp->message =~ /(\d+)\s+(\d+)\s+(\d+)\s+(\S+)/;
Branch: 1 branch
BranchTrueFalseTotal
unless $nntp->_GROUP($newgrp) and $nntp->message =~ /(\d+)\s+(\d+)\s+(\d+)\s+(\S+)/ 0 0 0
Condition0%0/3
$nntp->_GROUP($newgrp) and $nntp->message =~ /(\d+)\s+(\d+)\s+(\d+)\s+(\S+)/
!ll&&!rl&&r
000
MC/DC0%0/2
$nntp->_GROUP($newgrp) and $nntp->message =~ /(\d+)\s+(\d+)\s+(\d+)\s+(\S+)/
$nntp->_GROUP($newgrp) $nntp->message =~ /(\d+)\s+(\d+)\s+(\d+)\s+(\S+)/
Truth table0%0/3
A and B
A= $nntp->_GROUP($newgrp)B= $nntp->message =~ /(\d+)\s+(\d+)\s+(\d+)\s+(\S+)/
ABresult
0X0
100
111
284  
285 0 my ($count, $first, $last, $group) = ($1, $2, $3, $4);
286  
287 # group may be replied as '(current group)'
288 0 ▶ $group = ${*$nntp}{'net_nntp_group'}
Branch: 1 branch
BranchTrueFalseTotal
if $group =~ /\(/ 0 0 0
289 if $group =~ /\(/;
290  
291 0 ${*$nntp}{'net_nntp_group'} = $group;
292  
293 wantarray
294 0 ▶ ? ($count, $first, $last, $group)
Branch: 1 branch
BranchTrueFalseTotal
wantarray ? : 0 0 0
295 : $group;
296 }
297  
298  
299 0 ▶sub help {
Subroutine help: not called CC=3 SCAR=24.8
Pod documented
300 0 ▶ @_ == 1 or croak 'usage: $nntp->help()';
Branch: 1 branch
BranchTrueFalseTotal
@_ == 1 or croak("usage: \$nntp->help()") 0 0 0
301 0 my $nntp = shift;
302  
303 0 ▶ $nntp->_HELP
Branch: 1 branch
BranchTrueFalseTotal
$nntp->_HELP ? : 0 0 0
304 ? $nntp->read_until_dot
305 : undef;
306 }
307  
308  
309 0 ▶sub ihave {
Subroutine ihave: not called CC=5 SCAR=34.0
Pod documented
310 0 ▶ @_ >= 2 or croak 'usage: $nntp->ihave($msgid[, $message])';
Branch: 1 branch
BranchTrueFalseTotal
@_ >= 2 or croak("usage: \$nntp->ihave(\$msgid[, \$message])") 0 0 0
311 0 my $nntp = shift;
312 0 my $msgid = shift;
313  
314 0 ▶ $nntp->_IHAVE($msgid) && $nntp->datasend(@_)
Branch: 1 branch
BranchTrueFalseTotal
$nntp->_IHAVE($msgid) && $nntp->datasend(@_) ? : 0 0 0
Condition0%0/6
$nntp->_IHAVE($msgid) and $nntp->datasend(@_)
!ll&&!rl&&r
000
@_ == 0 or $nntp->dataend
l!l&&r!l&&!r
000
MC/DC0%0/2
$nntp->_IHAVE($msgid) and $nntp->datasend(@_)
$nntp->_IHAVE($msgid) $nntp->datasend(@_)
MC/DC0%0/2
@_ == 0 or $nntp->dataend
@_ == 0 $nntp->dataend
Truth table0%0/3
A and B
A= $nntp->_IHAVE($msgid)B= $nntp->datasend(@_)
ABresult
0X0
100
111
Truth table0%0/3
A or B
A= @_ == 0B= $nntp->dataend
ABresult
1X1
011
000
315 ? @_ == 0 || $nntp->dataend
316 : undef;
317 }
318  
319  
320 0 ▶sub last {
Subroutine last: not called CC=4 SCAR=30.0
Pod documented
321 0 ▶ @_ == 1 or croak 'usage: $nntp->last()';
Branch: 1 branch
BranchTrueFalseTotal
@_ == 1 or croak("usage: \$nntp->last()") 0 0 0
322 0 my $nntp = shift;
323  
324 0 ▶ $nntp->_LAST && $nntp->message =~ /(<[^>]+>)/o
Branch: 1 branch
BranchTrueFalseTotal
$nntp->_LAST && $nntp->message =~ /(<[^>]+>)/o ? : 0 0 0
Condition0%0/3
$nntp->_LAST and $nntp->message =~ /(<[^>]+>)/o
!ll&&!rl&&r
000
MC/DC0%0/2
$nntp->_LAST and $nntp->message =~ /(<[^>]+>)/o
$nntp->_LAST $nntp->message =~ /(<[^>]+>)/o
Truth table0%0/3
A and B
A= $nntp->_LASTB= $nntp->message =~ /(<[^>]+>)/o
ABresult
0X0
100
111
325 ? $1
326 : undef;
327 }
328  
329  
330 0 ▶sub list {
Subroutine list: not called CC=3 SCAR=24.8
Pod documented
331 0 ▶ @_ == 1 or croak 'usage: $nntp->list()';
Branch: 1 branch
BranchTrueFalseTotal
@_ == 1 or croak("usage: \$nntp->list()") 0 0 0
332 0 my $nntp = shift;
333  
334 0 ▶ $nntp->_LIST
Branch: 1 branch
BranchTrueFalseTotal
$nntp->_LIST ? : 0 0 0
335 ? $nntp->_grouplist
336 : undef;
337 }
338  
339  
340 0 ▶sub newgroups {
Subroutine newgroups: not called CC=5 SCAR=34.0
Pod documented
341 0 ▶ @_ >= 2 or croak 'usage: $nntp->newgroups($since[, $distributions])';
Branch: 1 branch
BranchTrueFalseTotal
@_ >= 2 or croak("usage: \$nntp->newgroups(\$since[, \$distributions])") 0 0 0
342 0 my $nntp = shift;
343 0 my $since = _timestr(shift);
344 0 ▶ my $distributions = shift || "";
Condition0%0/2
shift() || ''
l!l
00
MC/DC0%0/1
shift() || ''
shift()
Truth table0%0/2
A
A= shift()
Aresult
11
00
345  
346 0 ▶ $distributions = join(",", @{$distributions})
Branch: 1 branch
BranchTrueFalseTotal
if ref $distributions 0 0 0
347 if ref($distributions);
348  
349 0 ▶ $nntp->_NEWGROUPS($since, $distributions)
Branch: 1 branch
BranchTrueFalseTotal
$nntp->_NEWGROUPS($since, $distributions) ? : 0 0 0
350 ? $nntp->_grouplist
351 : undef;
352 }
353  
354  
355 0 ▶sub newnews {
Subroutine newnews: not called CC=9 SCAR=45.0
Pod documented
356 0 ▶ @_ >= 2 && @_ <= 4
Branch: 1 branch
BranchTrueFalseTotal
@_ >= 2 and @_ <= 4 or croak("usage: \$nntp->newnews(\$since[, \$groups[, \$distributions]])") 0 0 0
Condition0%0/3
@_ >= 2 and @_ <= 4
!ll&&!rl&&r
000
MC/DC0%0/2
@_ >= 2 and @_ <= 4
@_ >= 2 @_ <= 4
Truth table0%0/3
A and B
A= @_ >= 2B= @_ <= 4
ABresult
0X0
100
111
357 or croak 'usage: $nntp->newnews($since[, $groups[, $distributions]])';
358 0 my $nntp = shift;
359 0 my $since = _timestr(shift);
360 0 ▶ my $groups = @_ ? shift : $nntp->group;
Branch: 1 branch
BranchTrueFalseTotal
@_ ? : 0 0 0
361 0 ▶ my $distributions = shift || "";
Condition0%0/2
shift() || ''
l!l
00
MC/DC0%0/1
shift() || ''
shift()
Truth table0%0/2
A
A= shift()
Aresult
11
00
362  
363 0 ▶ $groups ||= "*";
Condition0%0/2
$groups ||= "*"
l!l
00
MC/DC0%0/1
$groups ||= "*"
$groups
Truth table0%0/2
A
A= $groups
Aresult
11
00
364 0 ▶ $groups = join(",", @{$groups})
Branch: 1 branch
BranchTrueFalseTotal
if ref $groups 0 0 0
365 if ref($groups);
366  
367 0 ▶ $distributions = join(",", @{$distributions})
Branch: 1 branch
BranchTrueFalseTotal
if ref $distributions 0 0 0
368 if ref($distributions);
369  
370 0 ▶ $nntp->_NEWNEWS($groups, $since, $distributions)
Branch: 1 branch
BranchTrueFalseTotal
$nntp->_NEWNEWS($groups, $since, $distributions) ? : 0 0 0
371 ? $nntp->_articlelist
372 : undef;
373 }
374  
375  
376 0 ▶sub next {
Subroutine next: not called CC=4 SCAR=30.0
Pod documented
377 0 ▶ @_ == 1 or croak 'usage: $nntp->next()';
Branch: 1 branch
BranchTrueFalseTotal
@_ == 1 or croak("usage: \$nntp->next()") 0 0 0
378 0 my $nntp = shift;
379  
380 0 ▶ $nntp->_NEXT && $nntp->message =~ /(<[^>]+>)/o
Branch: 1 branch
BranchTrueFalseTotal
$nntp->_NEXT && $nntp->message =~ /(<[^>]+>)/o ? : 0 0 0
Condition0%0/3
$nntp->_NEXT and $nntp->message =~ /(<[^>]+>)/o
!ll&&!rl&&r
000
MC/DC0%0/2
$nntp->_NEXT and $nntp->message =~ /(<[^>]+>)/o
$nntp->_NEXT $nntp->message =~ /(<[^>]+>)/o
Truth table0%0/3
A and B
A= $nntp->_NEXTB= $nntp->message =~ /(<[^>]+>)/o
ABresult
0X0
100
111
381 ? $1
382 : undef;
383 }
384  
385  
386 0 ▶sub post {
Subroutine post: not called CC=5 SCAR=34.0
Pod documented
387 0 ▶ @_ >= 1 or croak 'usage: $nntp->post([$message])';
Branch: 1 branch
BranchTrueFalseTotal
@_ >= 1 or croak("usage: \$nntp->post([\$message])") 0 0 0
388 0 my $nntp = shift;
389  
390 0 ▶ $nntp->_POST() && $nntp->datasend(@_)
Branch: 1 branch
BranchTrueFalseTotal
$nntp->_POST && $nntp->datasend(@_) ? : 0 0 0
Condition0%0/6
$nntp->_POST and $nntp->datasend(@_)
!ll&&!rl&&r
000
@_ == 0 or $nntp->dataend
l!l&&r!l&&!r
000
MC/DC0%0/2
$nntp->_POST and $nntp->datasend(@_)
$nntp->_POST $nntp->datasend(@_)
MC/DC0%0/2
@_ == 0 or $nntp->dataend
@_ == 0 $nntp->dataend
Truth table0%0/3
A and B
A= $nntp->_POSTB= $nntp->datasend(@_)
ABresult
0X0
100
111
Truth table0%0/3
A or B
A= @_ == 0B= $nntp->dataend
ABresult
1X1
011
000
391 ? @_ == 0 || $nntp->dataend
392 : undef;
393 }
394  
395  
396 0 ▶sub postfh {
Subroutine postfh: not called CC=2 SCAR=17.9
Pod documented
397 0 my $nntp = shift;
398 0 ▶ return unless $nntp->_POST();
Branch: 1 branch
BranchTrueFalseTotal
unless $nntp->_POST 0 0 0
399 0 return $nntp->tied_fh;
400 }
401  
402  
403 3 ▶sub quit {
Subroutine quit: called CC=2 SCAR=7.0
Pod documented
404 3 ▶ @_ == 1 or croak 'usage: $nntp->quit()';
Branch: 1 branch
BranchTrueFalseTotal
@_ == 1 or croak("usage: \$nntp->quit()") 3 0 3
405 3 my $nntp = shift;
406  
407 3 $nntp->_QUIT;
408 3 $nntp->close;
409 }
410  
411  
412 0 ▶sub slave {
Subroutine slave: not called CC=2 SCAR=17.9
Pod documented
413 0 ▶ @_ == 1 or croak 'usage: $nntp->slave()';
Branch: 1 branch
BranchTrueFalseTotal
@_ == 1 or croak("usage: \$nntp->slave()") 0 0 0
414 0 my $nntp = shift;
415  
416 0 $nntp->_SLAVE;
417 }
418  
419 ##
420 ## The following methods are not implemented by all servers
421 ##
422  
423  
424 0 ▶sub active {
Subroutine active: not called CC=4 SCAR=30.0
Pod documented
425 0 ▶ @_ == 1 || @_ == 2 or croak 'usage: $nntp->active([$pattern])';
Branch: 1 branch
BranchTrueFalseTotal
@_ == 1 or @_ == 2 or croak("usage: \$nntp->active([\$pattern])") 0 0 0
Condition0%0/3
@_ == 1 or @_ == 2
l!l&&r!l&&!r
000
MC/DC0%0/2
@_ == 1 or @_ == 2
@_ == 1 @_ == 2
Truth table0%0/3
A or B
A= @_ == 1B= @_ == 2
ABresult
1X1
011
000
426 0 my $nntp = shift;
427  
428 0 ▶ $nntp->_LIST('ACTIVE', @_)
Branch: 1 branch
BranchTrueFalseTotal
$nntp->_LIST('ACTIVE', @_) ? : 0 0 0
429 ? $nntp->_grouplist
430 : undef;
431 }
432  
433  
434 0 ▶sub active_times {
Subroutine active_times: not called CC=3 SCAR=24.8
Pod documented
435 0 ▶ @_ == 1 or croak 'usage: $nntp->active_times()';
Branch: 1 branch
BranchTrueFalseTotal
@_ == 1 or croak("usage: \$nntp->active_times()") 0 0 0
436 0 my $nntp = shift;
437  
438 0 ▶ $nntp->_LIST('ACTIVE.TIMES')
Branch: 1 branch
BranchTrueFalseTotal
$nntp->_LIST('ACTIVE.TIMES') ? : 0 0 0
439 ? $nntp->_grouplist
440 : undef;
441 }
442  
443  
444 0 ▶sub distributions {
Subroutine distributions: not called CC=3 SCAR=24.8
Pod documented
445 0 ▶ @_ == 1 or croak 'usage: $nntp->distributions()';
Branch: 1 branch
BranchTrueFalseTotal
@_ == 1 or croak("usage: \$nntp->distributions()") 0 0 0
446 0 my $nntp = shift;
447  
448 0 ▶ $nntp->_LIST('DISTRIBUTIONS')
Branch: 1 branch
BranchTrueFalseTotal
$nntp->_LIST('DISTRIBUTIONS') ? : 0 0 0
449 ? $nntp->_description
450 : undef;
451 }
452  
453  
454 0 ▶sub distribution_patterns {
Subroutine distribution_patterns: not called CC=5 SCAR=34.0
Pod documented
455 0 ▶ @_ == 1 or croak 'usage: $nntp->distribution_patterns()';
Branch: 1 branch
BranchTrueFalseTotal
@_ == 1 or croak("usage: \$nntp->distribution_patterns()") 0 0 0
456 0 my $nntp = shift;
457  
458 0 my $arr;
459 0 local $_;
460  
461 ## no critic (ControlStructures::ProhibitMutatingListFunctions)
462 $nntp->_LIST('DISTRIB.PATS')
463 && ($arr = $nntp->read_until_dot)
464 0 ▶ ? [grep { /^\d/ && (chomp, $_ = [split /:/]) } @$arr]
Branch: 1 branch
BranchTrueFalseTotal
$nntp->_LIST('DISTRIB.PATS') && ($arr = $nntp->read_until_dot) ? : 0 0 0
Condition0%0/6
$nntp->_LIST("DISTRIB.PATS") and $arr = $nntp->read_until_dot
!ll&&!rl&&r
000
/^\d/ && (chomp $_, $_ = [split(/:/, $_, 0)])
!ll&&!rl&&r
000
MC/DC0%0/2
$nntp->_LIST("DISTRIB.PATS") and $arr = $nntp->read_until_dot
$nntp->_LIST("DISTRIB.PATS") $arr = $nntp->read_until_dot
MC/DC0%0/2
/^\d/ && (chomp $_, $_ = [split(/:/, $_, 0)])
/^\d/ (chomp $_, $_ = [split(/:/, $_, 0)])
Truth table0%0/3
A and B
A= $nntp->_LIST("DISTRIB.PATS")B= $arr = $nntp->read_until_dot
ABresult
0X0
100
111
Truth table0%0/3
A && B
A= /^\d/B= (chomp $_, $_ = [split(/:/, $_, 0)])
ABresult
0X0
100
111
465 : undef;
466 }
467  
468  
469 0 ▶sub newsgroups {
Subroutine newsgroups: not called CC=4 SCAR=30.0
Pod documented
470 0 ▶ @_ == 1 || @_ == 2 or croak 'usage: $nntp->newsgroups([$pattern])';
Branch: 1 branch
BranchTrueFalseTotal
@_ == 1 or @_ == 2 or croak("usage: \$nntp->newsgroups([\$pattern])") 0 0 0
Condition0%0/3
@_ == 1 or @_ == 2
l!l&&r!l&&!r
000
MC/DC0%0/2
@_ == 1 or @_ == 2
@_ == 1 @_ == 2
Truth table0%0/3
A or B
A= @_ == 1B= @_ == 2
ABresult
1X1
011
000
471 0 my $nntp = shift;
472  
473 0 ▶ $nntp->_LIST('NEWSGROUPS', @_)
Branch: 1 branch
BranchTrueFalseTotal
$nntp->_LIST('NEWSGROUPS', @_) ? : 0 0 0
474 ? $nntp->_description
475 : undef;
476 }
477  
478  
479 0 ▶sub overview_fmt {
Subroutine overview_fmt: not called CC=3 SCAR=24.8
Pod documented
480 0 ▶ @_ == 1 or croak 'usage: $nntp->overview_fmt()';
Branch: 1 branch
BranchTrueFalseTotal
@_ == 1 or croak("usage: \$nntp->overview_fmt()") 0 0 0
481 0 my $nntp = shift;
482  
483 0 ▶ $nntp->_LIST('OVERVIEW.FMT')
Branch: 1 branch
BranchTrueFalseTotal
$nntp->_LIST('OVERVIEW.FMT') ? : 0 0 0
484 ? $nntp->_articlelist
485 : undef;
486 }
487  
488  
489 0 ▶sub subscriptions {
Subroutine subscriptions: not called CC=3 SCAR=24.8
Pod documented
490 0 ▶ @_ == 1 or croak 'usage: $nntp->subscriptions()';
Branch: 1 branch
BranchTrueFalseTotal
@_ == 1 or croak("usage: \$nntp->subscriptions()") 0 0 0
491 0 my $nntp = shift;
492  
493 0 ▶ $nntp->_LIST('SUBSCRIPTIONS')
Branch: 1 branch
BranchTrueFalseTotal
$nntp->_LIST('SUBSCRIPTIONS') ? : 0 0 0
494 ? $nntp->_articlelist
495 : undef;
496 }
497  
498  
499 0 ▶sub listgroup {
Subroutine listgroup: not called CC=4 SCAR=30.0
Pod documented
500 0 ▶ @_ == 1 || @_ == 2 or croak 'usage: $nntp->listgroup([$group])';
Branch: 1 branch
BranchTrueFalseTotal
@_ == 1 or @_ == 2 or croak("usage: \$nntp->listgroup([\$group])") 0 0 0
Condition0%0/3
@_ == 1 or @_ == 2
l!l&&r!l&&!r
000
MC/DC0%0/2
@_ == 1 or @_ == 2
@_ == 1 @_ == 2
Truth table0%0/3
A or B
A= @_ == 1B= @_ == 2
ABresult
1X1
011
000
501 0 my $nntp = shift;
502  
503 0 ▶ $nntp->_LISTGROUP(@_)
Branch: 1 branch
BranchTrueFalseTotal
$nntp->_LISTGROUP(@_) ? : 0 0 0
504 ? $nntp->_articlelist
505 : undef;
506 }
507  
508  
509 3 ▶sub reader {
Subroutine reader: called CC=2 SCAR=7.1
Pod documented
510 3 ▶ @_ == 1 or croak 'usage: $nntp->reader()';
Branch: 1 branch
BranchTrueFalseTotal
@_ == 1 or croak("usage: \$nntp->reader()") 3 0 3
511 3 my $nntp = shift;
512  
513 3 $nntp->_MODE('READER');
514 }
515  
516  
517 0 ▶sub xgtitle {
Subroutine xgtitle: not called CC=4 SCAR=30.0
Pod documented
518 0 ▶ @_ == 1 || @_ == 2 or croak 'usage: $nntp->xgtitle([$pattern])';
Branch: 1 branch
BranchTrueFalseTotal
@_ == 1 or @_ == 2 or croak("usage: \$nntp->xgtitle([\$pattern])") 0 0 0
Condition0%0/3
@_ == 1 or @_ == 2
l!l&&r!l&&!r
000
MC/DC0%0/2
@_ == 1 or @_ == 2
@_ == 1 @_ == 2
Truth table0%0/3
A or B
A= @_ == 1B= @_ == 2
ABresult
1X1
011
000
519 0 my $nntp = shift;
520  
521 0 ▶ $nntp->_XGTITLE(@_)
Branch: 1 branch
BranchTrueFalseTotal
$nntp->_XGTITLE(@_) ? : 0 0 0
522 ? $nntp->_description
523 : undef;
524 }
525  
526  
527 0 ▶sub xhdr {
Subroutine xhdr: not called CC=4 SCAR=30.0
Pod documented
528 0 ▶ @_ >= 2 && @_ <= 4 or croak 'usage: $nntp->xhdr($header[, $message_spec])';
Branch: 1 branch
BranchTrueFalseTotal
@_ >= 2 and @_ <= 4 or croak("usage: \$nntp->xhdr(\$header[, \$message_spec])") 0 0 0
Condition0%0/3
@_ >= 2 and @_ <= 4
!ll&&!rl&&r
000
MC/DC0%0/2
@_ >= 2 and @_ <= 4
@_ >= 2 @_ <= 4
Truth table0%0/3
A and B
A= @_ >= 2B= @_ <= 4
ABresult
0X0
100
111
529 0 my $nntp = shift;
530 0 my $header = shift;
531 0 my $arg = _msg_arg(@_);
532  
533 0 ▶ $nntp->_XHDR($header, $arg)
Branch: 1 branch
BranchTrueFalseTotal
$nntp->_XHDR($header, $arg) ? : 0 0 0
534 ? $nntp->_description
535 : undef;
536 }
537  
538  
539 0 ▶sub xover {
Subroutine xover: not called CC=4 SCAR=30.0
Pod documented
540 0 ▶ @_ == 2 || @_ == 3 or croak 'usage: $nntp->xover($message_spec)';
Branch: 1 branch
BranchTrueFalseTotal
@_ == 2 or @_ == 3 or croak("usage: \$nntp->xover(\$message_spec)") 0 0 0
Condition0%0/3
@_ == 2 or @_ == 3
l!l&&r!l&&!r
000
MC/DC0%0/2
@_ == 2 or @_ == 3
@_ == 2 @_ == 3
Truth table0%0/3
A or B
A= @_ == 2B= @_ == 3
ABresult
1X1
011
000
541 0 my $nntp = shift;
542 0 my $arg = _msg_arg(@_);
543  
544 0 ▶ $nntp->_XOVER($arg)
Branch: 1 branch
BranchTrueFalseTotal
$nntp->_XOVER($arg) ? : 0 0 0
545 ? $nntp->_fieldlist
546 : undef;
547 }
548  
549  
550 0 ▶sub xpat {
Subroutine xpat: not called CC=5 SCAR=34.0
Pod documented
551 0 ▶ @_ == 4 || @_ == 5 or croak 'usage: $nntp->xpat($header, $pattern, $message_spec )';
Branch: 1 branch
BranchTrueFalseTotal
@_ == 4 or @_ == 5 or croak("usage: \$nntp->xpat(\$header, \$pattern, \$message_spec )") 0 0 0
Condition0%0/3
@_ == 4 or @_ == 5
l!l&&r!l&&!r
000
MC/DC0%0/2
@_ == 4 or @_ == 5
@_ == 4 @_ == 5
Truth table0%0/3
A or B
A= @_ == 4B= @_ == 5
ABresult
1X1
011
000
552 0 my $nntp = shift;
553 0 my $header = shift;
554 0 my $pattern = shift;
555 0 my $arg = _msg_arg(@_);
556  
557 0 ▶ $pattern = join(" ", @$pattern)
Branch: 1 branch
BranchTrueFalseTotal
if ref $pattern 0 0 0
558 if ref($pattern);
559  
560 0 ▶ $nntp->_XPAT($header, $arg, $pattern)
Branch: 1 branch
BranchTrueFalseTotal
$nntp->_XPAT($header, $arg, $pattern) ? : 0 0 0
561 ? $nntp->_description
562 : undef;
563 }
564  
565  
566 0 ▶sub xpath {
Subroutine xpath: not called CC=4 SCAR=30.0
Pod documented
567 0 ▶ @_ == 2 or croak 'usage: $nntp->xpath($message_id)';
Branch: 1 branch
BranchTrueFalseTotal
@_ == 2 or croak("usage: \$nntp->xpath(\$message_id)") 0 0 0
568 0 my ($nntp, $message_id) = @_;
569  
570 return
571 0 ▶ unless $nntp->_XPATH($message_id);
Branch: 1 branch
BranchTrueFalseTotal
unless $nntp->_XPATH($message_id) 0 0 0
572  
573 0 my $m;
574 0 ($m = $nntp->message) =~ s/^\d+\s+//o;
575 0 my @p = split /\s+/, $m;
576  
577 0 ▶ wantarray ? @p : $p[0];
Branch: 1 branch
BranchTrueFalseTotal
wantarray ? : 0 0 0
578 }
579  
580  
581 0 ▶sub xrover {
Subroutine xrover: not called CC=4 SCAR=30.0
Pod documented
582 0 ▶ @_ == 2 || @_ == 3 or croak 'usage: $nntp->xrover($message_spec)';
Branch: 1 branch
BranchTrueFalseTotal
@_ == 2 or @_ == 3 or croak("usage: \$nntp->xrover(\$message_spec)") 0 0 0
Condition0%0/3
@_ == 2 or @_ == 3
l!l&&r!l&&!r
000
MC/DC0%0/2
@_ == 2 or @_ == 3
@_ == 2 @_ == 3
Truth table0%0/3
A or B
A= @_ == 2B= @_ == 3
ABresult
1X1
011
000
583 0 my $nntp = shift;
584 0 my $arg = _msg_arg(@_);
585  
586 0 ▶ $nntp->_XROVER($arg)
Branch: 1 branch
BranchTrueFalseTotal
$nntp->_XROVER($arg) ? : 0 0 0
587 ? $nntp->_description
588 : undef;
589 }
590  
591  
592 0 ▶sub date {
Subroutine date: not called CC=4 SCAR=30.0
Pod documented
593 0 ▶ @_ == 1 or croak 'usage: $nntp->date()';
Branch: 1 branch
BranchTrueFalseTotal
@_ == 1 or croak("usage: \$nntp->date()") 0 0 0
594 0 my $nntp = shift;
595  
596 0 ▶ $nntp->_DATE
Branch: 1 branch
BranchTrueFalseTotal
$nntp->_DATE && $nntp->message =~ /(\d{4})(\d\d)(\d\d)(\d\d)(\d\d)(\d\d)/ ? : 0 0 0
Condition0%0/3
$nntp->_DATE and $nntp->message =~ /(\d{4})(\d\d)(\d\d)(\d\d)(\d\d)(\d\d)/
!ll&&!rl&&r
000
MC/DC0%0/2
$nntp->_DATE and $nntp->message =~ /(\d{4})(\d\d)(\d\d)(\d\d)(\d\d)(\d\d)/
$nntp->_DATE $nntp->message =~ /(\d{4})(\d\d)(\d\d)(\d\d)(\d\d)(\d\d)/
Truth table0%0/3
A and B
A= $nntp->_DATEB= $nntp->message =~ /(\d{4})(\d\d)(\d\d)(\d\d)(\d\d)(\d\d)/
ABresult
0X0
100
111
597 && $nntp->message =~ /(\d{4})(\d\d)(\d\d)(\d\d)(\d\d)(\d\d)/
598 ? timegm($6, $5, $4, $3, $2 - 1, $1)
599 : undef;
600 }
601  
602  
603 ##
604 ## Private subroutines
605 ##
606  
607  
608 0 ▶sub _msg_arg {
Subroutine _msg_arg: not called CC=8 SCAR=42.8
609 0 my $spec = shift;
610 0 my $arg = "";
611  
612 0 ▶ if (@_) {
Branch: 1 branch
BranchTrueFalseTotal
if (@_) 0 0 0
613 0 ▶ carp "Depriciated passing of two message numbers, " . "pass a reference"
Branch: 1 branch
BranchTrueFalseTotal
if $^W 0 0 0
614 if $^W;
615 0 $spec = [$spec, $_[0]];
616 }
617  
618 0 ▶ if (defined $spec) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $spec) 0 0 0
619 0 ▶ if (ref($spec)) {
Branch: 1 branch
BranchTrueFalseTotal
if (ref $spec) { } 0 0 0
620 0 $arg = $spec->[0];
621 0 ▶ if (defined $spec->[1]) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $spec->[1]) 0 0 0
622 0 ▶ $arg .= "-"
Branch: 1 branch
BranchTrueFalseTotal
if $spec->[1] != $spec->[0] 0 0 0
623 if $spec->[1] != $spec->[0];
624 0 ▶ $arg .= $spec->[1]
Branch: 1 branch
BranchTrueFalseTotal
if $spec->[1] > $spec->[0] 0 0 0
625 if $spec->[1] > $spec->[0];
626 }
627 }
628 else {
629 0 $arg = $spec;
630 }
631 }
632  
633 0 $arg;
634 }
635  
636  
637 0 ▶sub _timestr {
Subroutine _timestr: not called CC=1 SCAR=6.9
638 0 my $time = shift;
639 0 my @g = reverse((gmtime($time))[0 .. 5]);
640 0 $g[1] += 1;
641 0 $g[0] %= 100;
642 0 sprintf "%02d%02d%02d %02d%02d%02d GMT", @g;
643 }
644  
645  
646 0 ▶sub _grouplist {
Subroutine _grouplist: not called CC=3 SCAR=24.8
647 0 my $nntp = shift;
648 0 ▶ my $arr = $nntp->read_until_dot
Branch: 1 branch
BranchTrueFalseTotal
my $arr = $nntp->read_until_dot or return 0 0 0
649 or return;
650  
651 0 my $hash = {};
652  
653 0 foreach my $ln (@$arr) {
654 0 my @a = split(/[\s\n]+/, $ln);
655 0 $hash->{$a[0]} = [@a[1, 2, 3]];
656 }
657  
658 0 $hash;
659 }
660  
661  
662 0 ▶sub _fieldlist {
Subroutine _fieldlist: not called CC=3 SCAR=24.8
663 0 my $nntp = shift;
664 0 ▶ my $arr = $nntp->read_until_dot
Branch: 1 branch
BranchTrueFalseTotal
my $arr = $nntp->read_until_dot or return 0 0 0
665 or return;
666  
667 0 my $hash = {};
668  
669 0 foreach my $ln (@$arr) {
670 0 my @a = split(/[\t\n]/, $ln);
671 0 my $m = shift @a;
672 0 $hash->{$m} = [@a];
673 }
674  
675 0 $hash;
676 }
677  
678  
679 0 ▶sub _articlelist {
Subroutine _articlelist: not called CC=2 SCAR=17.9
680 0 my $nntp = shift;
681 0 my $arr = $nntp->read_until_dot;
682  
683 0 ▶ chomp(@$arr)
Branch: 1 branch
BranchTrueFalseTotal
if $arr 0 0 0
684 if $arr;
685  
686 0 $arr;
687 }
688  
689  
690 0 ▶sub _description {
Subroutine _description: not called CC=4 SCAR=30.0
691 0 my $nntp = shift;
692 0 ▶ my $arr = $nntp->read_until_dot
Branch: 1 branch
BranchTrueFalseTotal
my $arr = $nntp->read_until_dot or return 0 0 0
693 or return;
694  
695 0 my $hash = {};
696  
697 0 foreach my $ln (@$arr) {
698 0 chomp($ln);
699  
700 0 ▶ $hash->{$1} = $ln
Branch: 1 branch
BranchTrueFalseTotal
if $ln =~ s/^\s*(\S+)\s*//o 0 0 0
701 if $ln =~ s/^\s*(\S+)\s*//o;
702 }
703  
704 0 $hash;
705  
706 }
707  
708 ##
709 ## The commands
710 ##
711  
712  
713 0 ▶sub _ARTICLE { shift->command('ARTICLE', @_)->response == CMD_OK }
Subroutine _ARTICLE: not called CC=1 SCAR=6.9
714 0 ▶sub _AUTHINFO { shift->command('AUTHINFO', @_)->response }
Subroutine _AUTHINFO: not called CC=1 SCAR=6.9
715 0 ▶sub _BODY { shift->command('BODY', @_)->response == CMD_OK }
Subroutine _BODY: not called CC=1 SCAR=6.9
716 0 ▶sub _DATE { shift->command('DATE')->response == CMD_INFO }
Subroutine _DATE: not called CC=1 SCAR=6.9
717 0 ▶sub _GROUP { shift->command('GROUP', @_)->response == CMD_OK }
Subroutine _GROUP: not called CC=1 SCAR=6.9
718 0 ▶sub _HEAD { shift->command('HEAD', @_)->response == CMD_OK }
Subroutine _HEAD: not called CC=1 SCAR=6.9
719 0 ▶sub _HELP { shift->command('HELP', @_)->response == CMD_INFO }
Subroutine _HELP: not called CC=1 SCAR=6.9
720 0 ▶sub _IHAVE { shift->command('IHAVE', @_)->response == CMD_MORE }
Subroutine _IHAVE: not called CC=1 SCAR=6.9
721 0 ▶sub _LAST { shift->command('LAST')->response == CMD_OK }
Subroutine _LAST: not called CC=1 SCAR=6.9
722 0 ▶sub _LIST { shift->command('LIST', @_)->response == CMD_OK }
Subroutine _LIST: not called CC=1 SCAR=6.9
723 0 ▶sub _LISTGROUP { shift->command('LISTGROUP', @_)->response == CMD_OK }
Subroutine _LISTGROUP: not called CC=1 SCAR=6.9
724 0 ▶sub _NEWGROUPS { shift->command('NEWGROUPS', @_)->response == CMD_OK }
Subroutine _NEWGROUPS: not called CC=1 SCAR=6.9
725 0 ▶sub _NEWNEWS { shift->command('NEWNEWS', @_)->response == CMD_OK }
Subroutine _NEWNEWS: not called CC=1 SCAR=6.9
726 0 ▶sub _NEXT { shift->command('NEXT')->response == CMD_OK }
Subroutine _NEXT: not called CC=1 SCAR=6.9
727 0 ▶sub _POST { shift->command('POST', @_)->response == CMD_MORE }
Subroutine _POST: not called CC=1 SCAR=6.9
728 3 ▶sub _QUIT { shift->command('QUIT', @_)->response == CMD_OK }
Subroutine _QUIT: called CC=1 SCAR=0.0
729 0 ▶sub _SLAVE { shift->command('SLAVE', @_)->response == CMD_OK }
Subroutine _SLAVE: not called CC=1 SCAR=6.9
730 1 ▶sub _STARTTLS { shift->command("STARTTLS")->response() == CMD_MORE }
Subroutine _STARTTLS: called CC=1 SCAR=0.0
731 0 ▶sub _STAT { shift->command('STAT', @_)->response == CMD_OK }
Subroutine _STAT: not called CC=1 SCAR=6.9
732 3 ▶sub _MODE { shift->command('MODE', @_)->response == CMD_OK }
Subroutine _MODE: called CC=1 SCAR=0.0
733 0 ▶sub _XGTITLE { shift->command('XGTITLE', @_)->response == CMD_OK }
Subroutine _XGTITLE: not called CC=1 SCAR=6.9
734 0 ▶sub _XHDR { shift->command('XHDR', @_)->response == CMD_OK }
Subroutine _XHDR: not called CC=1 SCAR=6.9
735 0 ▶sub _XPAT { shift->command('XPAT', @_)->response == CMD_OK }
Subroutine _XPAT: not called CC=1 SCAR=6.9
736 0 ▶sub _XPATH { shift->command('XPATH', @_)->response == CMD_OK }
Subroutine _XPATH: not called CC=1 SCAR=6.9
737 0 ▶sub _XOVER { shift->command('XOVER', @_)->response == CMD_OK }
Subroutine _XOVER: not called CC=1 SCAR=6.9
738 0 ▶sub _XROVER { shift->command('XROVER', @_)->response == CMD_OK }
Subroutine _XROVER: not called CC=1 SCAR=6.9
739 0 ▶sub _XTHREAD { shift->unsupported }
Subroutine _XTHREAD: not called CC=1 SCAR=6.9
740 0 ▶sub _XSEARCH { shift->unsupported }
Subroutine _XSEARCH: not called CC=1 SCAR=6.9
741 0 ▶sub _XINDEX { shift->unsupported }
Subroutine _XINDEX: not called CC=1 SCAR=6.9
742  
743 ##
744 ## IO/perl methods
745 ##
746  
747  
748 0 ▶sub DESTROY {
Subroutine DESTROY: not called CC=2 SCAR=17.9
749 0 my $nntp = shift;
750 0 ▶ defined(fileno($nntp)) && $nntp->quit;
Branch: 1 branch
BranchTrueFalseTotal
defined fileno $nntp and $nntp->quit 0 0 0
751 }
752  
753 {
754 package Net::NNTP::_SSL;
755 6 ▶ our @ISA = ( $ssl_class ? ($ssl_class):(), 'Net::NNTP' );
Branch: 1 branch
BranchTrueFalseTotal
$ssl_class ? : 6 0 6
756 0 ▶ sub starttls { die "NNTP connection is already in SSL mode" }
Subroutine starttls: not called CC=1 SCAR=6.9
757 3 ▶ sub start_SSL {
Subroutine start_SSL: called CC=5 SCAR=17.8
758 3 my ($class,$nntp,%arg) = @_;
759 3 delete @arg{ grep { !m{^SSL_} } keys %arg };
760 3 ▶ ( $arg{SSL_verifycn_name} ||= $nntp->host )
Condition33%1/3
$arg{"SSL_verifycn_name"} ||= $nntp->host
l!l&&r!l&&!r
300
MC/DC0%0/2
$arg{"SSL_verifycn_name"} ||= $nntp->host
$arg{"SSL_verifycn_name"} $nntp->host
Truth table33%1/3
A ||= B
A= $arg{"SSL_verifycn_name"}B= $nntp->host
ABresult
1X1
011
000
761 =~s{(?<!:):[\w()]+$}{}; # strip port
762 $arg{SSL_hostname} = $arg{SSL_verifycn_name}
763 3 ▶ if ! defined $arg{SSL_hostname} && $class->can_client_sni;
Branch: 1 branch
BranchTrueFalseTotal
if not defined $arg{"SSL_hostname"} and $class->can_client_sni 3 0 3
Condition33%1/3
not defined $arg{"SSL_hostname"} and $class->can_client_sni
!ll&&!rl&&r
003
MC/DC0%0/2
not defined $arg{"SSL_hostname"} and $class->can_client_sni
not defined $arg{"SSL_hostname"} $class->can_client_sni
Truth table33%1/3
not(A) and B
A= not defined $arg{"SSL_hostname"}B= $class->can_client_sni
ABresult
0X0
100
111
764 3 my $ok = $class->SUPER::start_SSL($nntp,
765 SSL_verifycn_scheme => 'nntp',
766 %arg
767 );
768 3 ▶ $@ = $ssl_class->errstr if !$ok;
Branch: 1 branch
BranchTrueFalseTotal
unless $ok 0 3 3
769 3 return $ok;
770 }
771 }
772  
773  
774  
775  
776 6 1;
777  
778 __END__
« Netrc.pm ↑ Summary FTP/I.pm »