HTTP/Interface/System.pm

filter: Statementstmt 90.0% 18 / 20 Branchbran 50.0% 3 / 6 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 4 / 4 Podpod 0.0% 0 / 1 totaltotal 80.6% 25 / 31 CC 4 SCAR 10.6
CC
4
Cov
81%
create
4.3
BEGIN
1.0
BEGIN
1.0
CRAP 2.9
« HTTP/Interface/File/Base.pm ↑ Summary HTTP/File.pm »
1 #
2 # (c) Jan Gehring <jan.gehring@gmail.com>
3 #
4 # vim: set ts=3 sw=3 tw=0:
5 # vim: set expandtab:
6
7 package Rex::Endpoint::HTTP::Interface::System;
8
9 5 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 5 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12 5 ▶sub create {
Subroutine create: called CC=4 SCAR=14.6
Pod undocumented
13 5 my ($class, $type) = @_;
14  
15 5 ▶ if(! $type) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($type) 5 0 5
16 5 ▶ if($^O =~ m/MSWin/) {
Branch: 1 branch
BranchTrueFalseTotal
if ($^O =~ /MSWin/) { } 0 5 5
17 0 $type = "Windows";
18 }
19 else {
20 5 $type = "Base";
21 }
22 }
23  
24 5 my $klass = "Rex::Endpoint::HTTP::Interface::System::$type";
25 5 ▶ eval "use $klass";
Subroutine BEGIN: called CC=1 SCAR=0.0
26  
27 5 ▶ if($@) {
Branch: 1 branch
BranchTrueFalseTotal
if ($@) 0 5 5
28 0 die("Error loading Interface class ($klass).");
29 }
30  
31 5 return $klass->new;
32 }
33  
34 5 1;
« HTTP/Interface/File/Base.pm ↑ Summary HTTP/File.pm »