AnyEvent/FTP/Server/Role/Type.pm

filter: Statementstmt 100% 25 / 25 Branchbran 100% 2 / 2 Conditioncond 100% 3 / 3 MC/DCmcdc 100% 2 / 2 Subroutinesub 100% 7 / 7 Podpod 0.0% 0 / 2 totaltotal 95.1% 39 / 41 SCAR 11.0
CC
3
Cov
100%
cmd_type
3.0
BEGIN
1.0
BEGIN
1.0
CRAP 3.0
« AnyEvent/FTP/Client/Role/ListTransfer.pm ↑ Summary AnyEvent/FTP/Response.pm »
1 package AnyEvent::FTP::Server::Role::Type;
2  
3 24 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 24 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 24 ▶use 5.010;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 24 ▶use Moo::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 # ABSTRACT: Type role for FTP server
9 24 our $VERSION = '0.19'; # VERSION
10  
11  
12 has type => (
13 is => 'rw',
14 68 ▶ default => sub { 'A' },
Subroutine __ANON__: called CC=1 SCAR=0.0
15 24 );
16  
17  
18 3 ▶sub help_type { 'TYPE <sp> type-code (A, I)' }
Subroutine help_type: called CC=1 SCAR=0.0
Pod undocumented
19  
20 sub cmd_type
21 {
22 30 ▶ my($self, $con, $req) = @_;
Subroutine cmd_type: called CC=3 SCAR=11.0
Pod undocumented
23  
24 30 my $type = uc $req->args;
25 30 $type =~ s/^\s+//;
26 30 $type =~ s/\s+$//;
27  
28 30 ▶ if($type eq 'A' || $type eq 'I')
Branch: 1 branch
BranchTrueFalseTotal
if ($type eq 'A' or $type eq 'I') { } 28 2 30
Condition100%3/3
$type eq "A" or $type eq "I"
l!l&&r!l&&!r
3252
MC/DC100%2/2
$type eq "A" or $type eq "I"
$type eq "A" $type eq "I"
Truth table100%3/3
A or B
A= $type eq "A"B= $type eq "I"
ABresult
1X1
011
000
29 {
30 28 $self->type($type);
31 28 $con->send_response(200 => "Type set to $type");
32 }
33 else
34 {
35 2 $con->send_response(500 => "Type not understood");
36 }
37  
38 30 $self->done;
39 }
40  
41 # TODO: STRU MODE
42  
43 24 1;
44  
45 __END__
« AnyEvent/FTP/Client/Role/ListTransfer.pm ↑ Summary AnyEvent/FTP/Response.pm »