JobStatus.pm

filter: Statementstmt 100% 21 / 21 Branchbran 100% 8 / 8 Conditioncond 77.7% 7 / 9 MC/DCmcdc 66.6% 4 / 6 Subroutinesub 100% 8 / 8 Podpod 80.0% 4 / 5 totaltotal 91.2% 52 / 57 CC 8 SCAR 10.6
CC
8
Cov
95%
new
5.1
percent
3.0
progress
2.0
CRAP 2.9
« Task.pm ↑ Summary ResponseParser/Taskset.pm »
1 package Gearman::JobStatus;
2 8 ▶use version ();
Subroutine BEGIN: called CC=1 SCAR=0.0
3 8 $Gearman::JobStatus::VERSION = version->declare("2.004.015");
4  
5  
6 8 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 8 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 =head1 NAME
10  
11 Gearman::JobStatus - represents a job status in gearman distributed job system
12  
13 =head1 DESCRIPTION
14  
15 L<Gearman::Client> get_status($handle) returns I<Gearman::JobStatus> for a given handle
16  
17 =head1 METHODS
18  
19 =cut
20  
21 7 ▶sub new {
Subroutine new: called CC=5 SCAR=16.2
Pod undocumented
22 7 my ($class, $known, $running, $nu, $de) = @_;
23 7 ▶ $nu = '' unless defined($nu) && length($nu);
Branch: 1 branch
BranchTrueFalseTotal
unless defined $nu and length $nu 5 2 7
Condition66%2/3
defined $nu and length $nu
!ll&&!rl&&r
502
MC/DC50%1/2
defined $nu and length $nu
defined $nu length $nu
Truth table66%2/3
A and B
A= defined $nuB= length $nu
ABresult
0X0
100
111
24 7 ▶ $de = '' unless defined($de) && length($de);
Branch: 1 branch
BranchTrueFalseTotal
unless defined $de and length $de 5 2 7
Condition66%2/3
defined $de and length $de
!ll&&!rl&&r
502
MC/DC50%1/2
defined $de and length $de
defined $de length $de
Truth table66%2/3
A and B
A= defined $deB= length $de
ABresult
0X0
100
111
25  
26 7 return bless [$known, $running, $nu, $de], $class;
27 } ## end sub new
28  
29 =head2 known()
30  
31 =cut
32  
33 2 ▶sub known { shift->[0]; }
Subroutine known: called CC=1 SCAR=0.0
Pod documented
34  
35 =head2 running()
36  
37 =cut
38  
39 2 ▶sub running { shift->[1]; }
Subroutine running: called CC=1 SCAR=0.0
Pod documented
40  
41 =head2 progress()
42  
43 =cut
44  
45 2 ▶sub progress {
Subroutine progress: called CC=2 SCAR=6.9
Pod documented
46 2 my $self = shift;
47 2 ▶ return $self->[2] ne '' ? [$self->[2], $self->[3]] : undef;
Branch: 1 branch
BranchTrueFalseTotal
$self->[2] ne '' ? : 1 1 2
48 }
49  
50 =head2 percent()
51  
52 =cut
53  
54 3 ▶sub percent {
Subroutine percent: called CC=3 SCAR=11.0
Pod documented
55 3 my $self = shift;
56 3 ▶ return ($self->[2] ne '' && $self->[3])
Branch: 1 branch
BranchTrueFalseTotal
$self->[2] ne '' && $self->[3] ? : 1 2 3
Condition100%3/3
$self->[2] ne "" and $self->[3]
!ll&&!rl&&r
111
MC/DC100%2/2
$self->[2] ne "" and $self->[3]
$self->[2] ne "" $self->[3]
Truth table100%3/3
A and B
A= $self->[2] ne ""B= $self->[3]
ABresult
0X0
100
111
57 ? ($self->[2] / $self->[3])
58 : undef;
59 } ## end sub percent
60  
61 8 1;
« Task.pm ↑ Summary ResponseParser/Taskset.pm »