lib/SMB/Header.pm

filter: Statementstmt 58.8% 10 / 17 Branchbran n/a Conditioncond 0.0% 0 / 12 MC/DCmcdc 0.0% 0 / 6 Subroutinesub 50.0% 3 / 6 Podpod 33.3% 1 / 3 totaltotal 31.8% 14 / 44 SCAR 30.3
CC
7
Cov
34%
new
56.0
is_response
2.0
is_signed
2.0
CRAP 20.8
« lib/SMB/Packer.pm ↑ Summary blib/lib/SMB/Agent.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::Header;
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';
Subroutine BEGIN: called CC=1 SCAR=0.0
22  
23 sub new ($%) {
24 0 ▶ my $class = shift;
Subroutine new: not called CC=7 SCAR=40.3
Pod documented
25 0 my %options = @_;
26  
27 0 ▶ $options{code} // die "No code for $class";
Condition0%0/2
$options{"code"} // die("No code for $class")
l!l
00
MC/DC0%0/1
$options{"code"} // die("No code for $class")
$options{"code"}
Truth table0%0/2
A
A= $options{"code"}
Aresult
11
00
28 0 ▶ $options{mid} // die "No message id for $class";
Condition0%0/2
$options{"mid"} // die("No message id for $class")
l!l
00
MC/DC0%0/1
$options{"mid"} // die("No message id for $class")
$options{"mid"}
Truth table0%0/2
A
A= $options{"mid"}
Aresult
11
00
29  
30 return $class->SUPER::new(
31 %options,
32 code => $options{code},
33 status => $options{status} || 0,
34 uid => $options{uid} || 0,
35 tid => $options{tid} || 0,
36 mid => $options{mid},
37 flags => $options{flags} || 0,
38 signature => $options{signature},
39 0 ▶ );
Condition0%0/8
$options{'status'} || 0
l!l
00
$options{'uid'} || 0
l!l
00
$options{'tid'} || 0
l!l
00
$options{'flags'} || 0
l!l
00
MC/DC0%0/1
$options{'status'} || 0
$options{'status'}
MC/DC0%0/1
$options{'uid'} || 0
$options{'uid'}
MC/DC0%0/1
$options{'tid'} || 0
$options{'tid'}
MC/DC0%0/1
$options{'flags'} || 0
$options{'flags'}
Truth table0%0/2
A
A= $options{'status'}
Aresult
11
00
Truth table0%0/2
A
A= $options{'uid'}
Aresult
11
00
Truth table0%0/2
A
A= $options{'tid'}
Aresult
11
00
Truth table0%0/2
A
A= $options{'flags'}
Aresult
11
00
40 }
41  
42 sub is_response ($) {
43 0 ▶ die "Pure virtual method is called";
Subroutine is_response: not called CC=1 SCAR=6.9
Pod undocumented
44 }
45  
46 sub is_signed ($) {
47 0 ▶ die "Pure virtual method is called";
Subroutine is_signed: not called CC=1 SCAR=6.9
Pod undocumented
48 }
49  
50 1 1;
« lib/SMB/Packer.pm ↑ Summary blib/lib/SMB/Agent.pm »