lib/Rex/Apache/Deploy/Package/Base.pm

filter: Statementstmt 54.2% 19 / 35 Branchbran 0.0% 0 / 4 Conditioncond 0.0% 0 / 11 MC/DCmcdc 0.0% 0 / 7 Subroutinesub 62.5% 5 / 8 Podpod 0.0% 0 / 2 totaltotal 35.8% 24 / 67 CC 7 SCAR 22.3
CC
7
Cov
38%
new
20.0
prefix
12.0
__ANON__
4.5
CRAP 9.3
« lib/Rex/Apache/Deploy/Tomcat.pm ↑ Summary lib/Rex/Apache/Deploy/Package/deb.pm »
1 #
2 # (c) Jan Gehring <jan.gehring@gmail.com>
3 #
4 # vim: set ts=2 sw=2 tw=0:
5 # vim: set expandtab:
6  
7 package Rex::Apache::Deploy::Package::Base;
8  
9 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12 1 ▶use Rex::Commands::Gather;
Subroutine BEGIN: called CC=1 SCAR=0.0
13  
14 0 ▶sub new {
Subroutine new: not called CC=4 SCAR=30.0
Pod undocumented
15 0 my $that = shift;
16 0 ▶ my $proto = ref($that) || $that;
Condition0%0/3
ref $that || $that
l!l&&r!l&&!r
000
MC/DC0%0/2
ref $that || $that
ref $that $that
Truth table0%0/3
A || B
A= ref $thatB= $that
ABresult
1X1
011
000
17 0 my $self = {@_};
18  
19 0 bless( $self, $proto );
20  
21 0 my %sys_info = get_system_information();
22  
23 0 ▶ $self->{arch} ||= $sys_info{architecture}, $self->{version} ||= "1.0";
Condition0%0/5
$self->{"arch"} ||= $sys_info{"architecture"}
l!l&&r!l&&!r
000
$self->{"version"} ||= "1.0"
l!l
00
MC/DC0%0/2
$self->{"arch"} ||= $sys_info{"architecture"}
$self->{"arch"} $sys_info{"architecture"}
MC/DC0%0/1
$self->{"version"} ||= "1.0"
$self->{"version"}
Truth table0%0/3
A ||= B
A= $self->{"arch"}B= $sys_info{"architecture"}
ABresult
1X1
011
000
Truth table0%0/2
A
A= $self->{"version"}
Aresult
11
00
24  
25 0 return $self;
26 }
27  
28 1 for my $name (
29 qw/
30 path
31 source
32 release
33 epoch
34 version
35 arch
36 name
37 file_user
38 file_group
39 /
40 )
41 0 {
42 1 ▶ no strict 'refs';
Subroutine BEGIN: called CC=1 SCAR=0.0
43 9 ▶ *{ __PACKAGE__ . "::$name" } = sub {
Subroutine __ANON__: not called CC=2 SCAR=15.1
44 0 my ( $self, $data ) = @_;
45  
46 0 ▶ if ($data) {
Branch: 1 branch
BranchTrueFalseTotal
if ($data) 0 0 0
47 0 $self->{$name} = $data;
48 }
49  
50 0 $self->{$name};
51  
52 9 };
53 1 ▶ use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
54 }
55  
56 0 ▶sub prefix {
Subroutine prefix: not called CC=3 SCAR=24.8
Pod undocumented
57 0 my ( $self, $prefix ) = @_;
58  
59 0 ▶ if ($prefix) {
Branch: 1 branch
BranchTrueFalseTotal
if ($prefix) 0 0 0
60 0 $self->{prefix} = $prefix;
61 }
62  
63 0 ▶ return $self->{prefix} || $self->{path};
Condition0%0/3
$self->{'prefix'} || $self->{'path'}
l!l&&r!l&&!r
000
MC/DC0%0/2
$self->{'prefix'} || $self->{'path'}
$self->{'prefix'} $self->{'path'}
Truth table0%0/3
A || B
A= $self->{'prefix'}B= $self->{'path'}
ABresult
1X1
011
000
64 }
65  
66 1 1;
« lib/Rex/Apache/Deploy/Tomcat.pm ↑ Summary lib/Rex/Apache/Deploy/Package/deb.pm »