Tanker/Request.pm

filter: Statementstmt 50.0% 7 / 14 Branchbran n/a Conditioncond 0.0% 0 / 5 MC/DCmcdc 0.0% 0 / 3 Subroutinesub 50.0% 2 / 4 Podpod 0.0% 0 / 2 totaltotal 32.1% 9 / 28 CC 3 SCAR 19.0
CC
3
Cov
37%
new
12.0
get_data
2.0
BEGIN
1.0
CRAP 6.7
↑ Summary Tanker.pm »
1 package Tanker::Request;
2  
3 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6  
7 sub new ($$)
8 0 ▶{
Subroutine new: not called CC=3 SCAR=24.8
Pod undocumented
9 # standard stuff for creating a new object
10 # I'm not sure if this *should* be an object
11 # but I think it'll probably be useful in the end
12 0 my $proto = shift;
13 0 ▶ my $class = ref($proto) || $proto;
Condition0%0/3
ref $proto || $proto
l!l&&r!l&&!r
000
MC/DC0%0/2
ref $proto || $proto
ref $proto $proto
Truth table0%0/3
A || B
A= ref $protoB= $proto
ABresult
1X1
011
000
14
15 # yes, we must have a variable hash
16 0 ▶ my $self = shift || warn "No variable hash was passed to this Request\n";
Condition0%0/2
shift() || warn("No variable hash was passed to this Request\n")
l!l
00
MC/DC0%0/1
shift() || warn("No variable hash was passed to this Request\n")
shift()
Truth table0%0/2
A
A= shift()
Aresult
11
00
17  
18 # bless our self into a hash
19 0 bless ($self, $class);
20  
21 # and give it on back
22 0 return $self;
23 }
24  
25 sub get_data ($)
26 0 ▶{
Subroutine get_data: not called CC=1 SCAR=6.9
Pod undocumented
27 0 my ($self) = @_;
28  
29 0 return $self->{data};
30 }
31  
32  
33  
34 1 1;
35 __END__
↑ Summary Tanker.pm »