lib/Rex/File/Parser/Data.pm

filter: Statementstmt 96.6% 29 / 30 Branchbran 100% 6 / 6 Conditioncond 33.3% 1 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 83.3% 5 / 6 Podpod 0.0% 0 / 3 totaltotal 82.0% 41 / 50 CC 6 SCAR 11.3
CC
6
Cov
92%
_read_file
5.0
new
2.1
get
2.0
CRAP 3.1
« blib/lib/Rex/Report.pm ↑ Summary lib/Rex/Service/ALT.pm »
1 #
2 # (c) Jan Gehring <jan.gehring@gmail.com>
3 #
4  
5 package Rex::File::Parser::Data;
6  
7 49 ▶use v5.14.4;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 49 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 49 our $VERSION = '1.16.1'; # VERSION
11  
12 4 ▶sub new {
Subroutine new: called CC=2 SCAR=7.2
Pod undocumented
13 4 my $that = shift;
14 4 ▶ my $proto = ref($that) || $that;
Condition33%1/3
ref $that || $that
l!l&&r!l&&!r
040
MC/DC0%0/2
ref $that || $that
ref $that $that
Truth table33%1/3
A || B
A= ref $thatB= $that
ABresult
1X1
011
000
15 4 my $self = {@_};
16  
17 4 bless( $self, $proto );
18  
19 4 return $self;
20 }
21  
22 4 ▶sub read {
Subroutine read: called CC=1 SCAR=0.0
Pod undocumented
23 4 my ( $self, $file ) = @_;
24 4 return $self->_read_file($file);
25 }
26  
27 4 ▶sub _read_file {
Subroutine _read_file: called CC=5 SCAR=16.1
28 4 my ( $self, $file ) = @_;
29  
30 4 my $content = "";
31  
32 4 my $in_file = 0;
33 4 for my $line ( @{ $self->{"data"} } ) {
34 426 chomp $line;
35  
36 426 ▶ if ( $line eq "\@end" ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($line eq "\@end") 10 416 426
37 10 $in_file = 0;
38 10 next;
39 }
40  
41 416 ▶ if ($in_file) {
Branch: 1 branch
BranchTrueFalseTotal
if ($in_file) 170 246 416
42 170 $content .= $line . $/;
43 }
44  
45 416 ▶ if ( $line eq "\@$file" ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($line eq "\@$file") 4 412 416
46 4 $in_file = 1;
47 4 next;
48 }
49 }
50  
51 4 return $content;
52 }
53  
54 0 ▶sub get {
Subroutine get: not called CC=1 SCAR=6.9
Pod undocumented
55 0 my ( $self, $file ) = @_;
56 }
57  
58 49 1;
« blib/lib/Rex/Report.pm ↑ Summary lib/Rex/Service/ALT.pm »