Base/Data.pm

filter: Statementstmt 66.6% 18 / 27 Branchbran 16.6% 1 / 6 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 80.0% 4 / 5 Podpod 0.0% 0 / 2 totaltotal 57.5% 23 / 40 CC 5 SCAR 22.7
CC
5
Cov
58%
getDataBySections
20.0
getData
2.0
BEGIN
1.0
CRAP 9.7
« Base/Util.pm ↑ Summary Base/Clase.pm »
1 package Eixo::Base::Data;
2  
3 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use Eixo::Base::Clase;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 0 ▶sub getDataBySections{
Subroutine getDataBySections: not called CC=4 SCAR=30.0
Pod undocumented
7 0 my ($module) = @_;
8  
9 0 my $data = &getData($module);
10  
11 0 my $sections = {};
12 0 my $section_name = undef;
13  
14 0 foreach my $l (split(/\n/, $data)){
15  
16 0 ▶ if($l =~ /^\s*\@\@(\w+)/){
Branch: 1 branch
BranchTrueFalseTotal
if ($l =~ /^\s*\@\@(\w+)/) { } 0 0 0
17 0 $section_name = $1;
18 }
19 else{
20 0 ▶ $sections->{$section_name} .= "$l\n" if($section_name);
Branch: 1 branch
BranchTrueFalseTotal
if $section_name 0 0 0
21 }
22 }
23  
24 0 $sections;
25 }
26  
27 2 ▶sub getData{
Subroutine getData: called CC=2 SCAR=6.9
Pod undocumented
28 2 my ($module) = @_;
29  
30 1 ▶ no strict 'refs';
Subroutine BEGIN: called CC=1 SCAR=0.0
31  
32 2 my $f = \*{$module . '::DATA'};
33  
34 2 ▶ return undef unless(defined($f));
Branch: 1 branch
BranchTrueFalseTotal
unless defined $f 0 2 2
35  
36 2 my $pos = tell($f);
37  
38 2 my $datos = join('', <$f>);
39  
40 2 seek($f, $pos, 0);
41  
42 2 return $datos;
43 }
44  
45 1 1;
« Base/Util.pm ↑ Summary Base/Clase.pm »