MooseFS/Matrix.pm

filter: Statementstmt 34.8% 15 / 43 Branchbran 0.0% 0 / 6 Conditioncond 0.0% 0 / 9 MC/DCmcdc 0.0% 0 / 6 Subroutinesub 57.1% 4 / 7 Podpod 0.0% 0 / 1 totaltotal 26.3% 19 / 72 CC 10 SCAR 39.5
CC
10
Cov
26%
BUILD
90.0
__ANON__
6.0
__ANON__
2.0
CRAP 51.8
« MooseFS/Info.pm ↑ Summary MooseFS/Operations.pm »
1 package MooseFS::Matrix;
2 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use IO::Socket::INET;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 1 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 1 extends 'MooseFS';
8  
9 has info => (
10 is => 'rw',
11 0 ▶ default => sub { [] }
Subroutine __ANON__: not called CC=1 SCAR=6.9
12 1 );
13
14 0 ▶sub BUILD {
Subroutine BUILD: not called CC=9 SCAR=45.0
Pod undocumented
15 0 my $self = shift;
16 0 my $s = $self->sock;
17 0 print $s pack('(LL)>', 510, 0);
18 0 my $header = $self->myrecv($s, 8);
19 0 my ($cmd, $length) = unpack('(LL)>', $header);
20 0 my $data = $self->myrecv($s, $length);
21 0 my ($v1, $v2, $v3, $memusage, $total, $avail, $trspace, $trfiles, $respace, $refiles, $nodes, $dirs, $files, $chunks, $allcopies, $tdcopies) = unpack('(SCCQQQQLQLLLLLLL)>', $data);
22
23 0 ▶ if ($v2 > 5 and $v3 > 9) {
Branch: 2 branches
BranchTrueFalseTotal
if ($v2 > 5 and $v3 > 9) { } 0 0 0
elsif ($v2 > 4 and $v3 > 12) { } 0 0 0
Condition0%0/3
$v2 > 5 and $v3 > 9
!ll&&!rl&&r
000
MC/DC0%0/2
$v2 > 5 and $v3 > 9
$v2 > 5 $v3 > 9
Truth table0%0/3
A and B
A= $v2 > 5B= $v3 > 9
ABresult
0X0
100
111
24 0 print $s pack('(LLS)>', 516, 1, 0);
25 ▶ } elsif ($v2 > 4 and $v3 > 12) {
Condition0%0/3
$v2 > 4 and $v3 > 12
!ll&&!rl&&r
000
MC/DC0%0/2
$v2 > 4 and $v3 > 12
$v2 > 4 $v3 > 12
Truth table0%0/3
A and B
A= $v2 > 4B= $v3 > 12
ABresult
0X0
100
111
26 0 print $s pack('(LL)>', 516, 0);
27 } else {
28 0 die 'Too old version';
29 };
30 0 my $nheader = $self->myrecv($s, 8);
31 0 my ($ncmd, $nlength) = unpack('(LL)>', $nheader);
32 0 ▶ if ($ncmd == 517 and $nlength == 484) {
Branch: 1 branch
BranchTrueFalseTotal
if ($ncmd == 517 and $nlength == 484) 0 0 0
Condition0%0/3
$ncmd == 517 and $nlength == 484
!ll&&!rl&&r
000
MC/DC0%0/2
$ncmd == 517 and $nlength == 484
$ncmd == 517 $nlength == 484
Truth table0%0/3
A and B
A= $ncmd == 517B= $nlength == 484
ABresult
0X0
100
111
33 0 for my $i ( 0 .. 10 ) {
34 0 my $ndata = $self->myrecv($s, 44);
35 0 push @{ $self->info }, [ unpack("(LLLLLLLLLLL)>", $ndata) ];
36 };
37 };
38 0 for my $goal ( 0 .. $#{ $self->info } ) {
39 0 ▶ has "goal$goal" => (is => 'ro', lazy => 1, default => sub {
Subroutine __ANON__: not called CC=2 SCAR=17.9
40 0 my $self = shift;
41 0 my $info;
42 0 for my $valid ( 0 .. $#{ $self->info->[$goal] } ) {
43 0 $info->{"valid$valid"} = $self->info->[$goal]->[$valid];
44 };
45 0 return $info;
46 0 });
47 };
48 };
49  
50 1 1;
« MooseFS/Info.pm ↑ Summary MooseFS/Operations.pm »