lib/SMB/v1/Command.pm

filter: Statementstmt 59.0% 13 / 22 Branchbran 0.0% 0 / 4 Conditioncond 0.0% 0 / 5 MC/DCmcdc 0.0% 0 / 3 Subroutinesub 66.6% 4 / 6 Podpod 50.0% 1 / 2 totaltotal 42.8% 18 / 42 SCAR 22.9
CC
5
Cov
42%
new
30.0
prepare_response
2.0
BEGIN
1.0
CRAP 9.9
« lib/SMB/v2/Command/TreeConnect.pm ↑ Summary lib/SMB/Proxy.pm »
1 # SMB-Perl library, Copyright (C) 2014 Mikhael Goikhman, migo@cpan.org
2 #
3 # This program is free software: you can redistribute it and/or modify
4 # it under the terms of the GNU General Public License as published by
5 # the Free Software Foundation, either version 3 of the License, or
6 # (at your option) any later version.
7 #
8 # This program is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # GNU General Public License for more details.
12 #
13 # You should have received a copy of the GNU General Public License
14 # along with this program. If not, see <http://www.gnu.org/licenses/>.
15  
16 package SMB::v1::Command;
17  
18 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
19 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
20  
21 1 ▶use parent 'SMB::Command';
Subroutine BEGIN: called CC=1 SCAR=0.0
22  
23 1 ▶use SMB::v1::Header;
Subroutine BEGIN: called CC=1 SCAR=0.0
24  
25 sub new ($$%) {
26 0 ▶ my $class = shift;
Subroutine new: not called CC=5 SCAR=34.0
Pod documented
27 0 ▶ my $header = shift || '';
Condition0%0/2
shift() || ''
l!l
00
MC/DC0%0/1
shift() || ''
shift()
Truth table0%0/2
A
A= shift()
Aresult
11
00
28 0 my %options = @_;
29  
30 0 ▶ die "Invalid sub-class $class, should be SMB::v1::Command::*"
Branch: 1 branch
BranchTrueFalseTotal
unless $class =~ /^SMB::v1::Command::(\w+)/ 0 0 0
31 unless $class =~ /^SMB::v1::Command::(\w+)/;
32  
33 0 ▶ die "Invalid header '$header', should be isa SMB::v1::Header"
Branch: 1 branch
BranchTrueFalseTotal
unless $header and $header->isa("SMB::v1::Header") 0 0 0
Condition0%0/3
$header and $header->isa("SMB::v1::Header")
!ll&&!rl&&r
000
MC/DC0%0/2
$header and $header->isa("SMB::v1::Header")
$header $header->isa("SMB::v1::Header")
Truth table0%0/3
A and B
A= $headerB= $header->isa("SMB::v1::Header")
ABresult
0X0
100
111
34 unless $header && $header->isa('SMB::v1::Header');
35  
36 0 my $self = $class->SUPER::new(
37 1, $1, $header,
38 %options,
39 );
40  
41 0 return $self;
42 }
43  
44 sub prepare_response ($) {
45 0 ▶ my $self = shift;
Subroutine prepare_response: not called CC=1 SCAR=6.9
Pod undocumented
46  
47 0 $self->header->{flags} |= SMB::v1::Header::FLAGS_RESPONSE;
48 }
49  
50 1 1;
« lib/SMB/v2/Command/TreeConnect.pm ↑ Summary lib/SMB/Proxy.pm »