AnyEvent/FTP/Client/Response.pm

filter: Statementstmt 90.4% 19 / 21 Branchbran 66.6% 4 / 6 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 7 / 7 Podpod 100% 3 / 3 totaltotal 89.1% 33 / 37 SCAR 14.0
CC
4
Cov
85%
get_address_and_port
2.5
get_dir
2.1
get_file
2.0
CRAP 4.1
« AnyEvent/FTP/Server.pm ↑ Summary AnyEvent/FTP/Client/Transfer/Active.pm »
1 package AnyEvent::FTP::Client::Response;
2  
3 27 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 27 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 27 ▶use 5.010;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 27 ▶use base qw( AnyEvent::FTP::Response );
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 # ABSTRACT: Response class for asynchronous ftp client
9 27 our $VERSION = '0.19'; # VERSION
10  
11  
12 sub get_address_and_port
13 {
14 42 ▶ return ("$1.$2.$3.$4", $5*256+$6) if shift->{message}->[0] =~ /\((\d+),(\d+),(\d+),(\d+),(\d+),(\d+)\)/;
Subroutine get_address_and_port: called CC=2 SCAR=9.2
Pod documented
Branch: 1 branch
BranchTrueFalseTotal
if +(shift())->{"message"}[0] =~ /\((\d+),(\d+),(\d+),(\d+),(\d+),(\d+)\)/ 42 0 42
15 0 return;
16 }
17  
18  
19 sub get_dir
20 {
21 7 ▶ if(shift->{message}->[0] =~ /^"(.*)"/)
Subroutine get_dir: called CC=2 SCAR=7.4
Pod documented
Branch: 1 branch
BranchTrueFalseTotal
if (+(shift())->{"message"}[0] =~ /^"(.*)"/) 7 0 7
22 {
23 7 my $dir = $1;
24 7 $dir =~ s/""/"/;
25 7 return $dir;
26 }
27 0 return;
28 }
29  
30  
31 sub get_file
32 {
33 6 ▶ return shift->{message}->[0] =~ /^FILE: (.*)/i ? $1 : ();
Subroutine get_file: called CC=2 SCAR=6.9
Pod documented
Branch: 1 branch
BranchTrueFalseTotal
+(shift())->{'message'}[0] =~ /^FILE: (.*)/i ? : 3 3 6
34 }
35  
36 27 1;
37  
38 __END__
« AnyEvent/FTP/Server.pm ↑ Summary AnyEvent/FTP/Client/Transfer/Active.pm »