ODS/Utils.pm

filter: Statementstmt 100% 40 / 40 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 12 / 12 Podpod 0.0% 0 / 4 totaltotal 92.8% 52 / 56 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« ODS/Storage/File/JSON.pm ↑ Summary ODS/Table/Column/Epoch.pm »
1 package ODS::Utils;
2  
3 3 ▶use base 'Import::Export';
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 3 ▶use YAOO;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 3 ▶use Data::GUID;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 3 ▶use File::Copy qw/move/;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 3 ▶use Carp qw/croak/;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 3 ▶use Data::Dumper qw/Dumper/;
Subroutine BEGIN: called CC=1 SCAR=0.0
11
12 3 our %EX = (
13 load => [qw/all/],
14 clone => [qw/all/],
15 unique_id => [qw/all/],
16 build_temp_class => [qw/all/],
17 move => [qw/all/],
18 croak => [qw/error/],
19 Dumper => [qw/error/]
20 );
21  
22 sub clone {
23 32 ▶ my ($c) = @_;
Subroutine clone: called CC=1 SCAR=0.0
Pod undocumented
24 32 my $n = bless YAOO::deep_clone_ordered_hash($c), ref $c;
25 32 return $n;
26 }
27  
28 sub load {
29 51 ▶ my ($module) = shift;
Subroutine load: called CC=1 SCAR=0.0
Pod undocumented
30 51 (my $require = $module) =~ s/\:\:/\//g;
31 51 require $require . '.pm';
32 44 return $module;
33 }
34  
35 sub unique_class_name {
36 3 ▶ return 'A' . join("", split("-", Data::GUID->new->as_string()));
Subroutine unique_class_name: called CC=1 SCAR=0.0
Pod undocumented
37 }
38  
39 sub build_temp_class {
40 3 ▶ my ($class) = @_;
Subroutine build_temp_class: called CC=1 SCAR=0.0
Pod undocumented
41 3 load $class;
42 3 my $temp = $class . '::' . unique_class_name();
43 3 my $c = sprintf(
44 q|
45 package %s;
46 use YAOO;
47 extends '%s';
48 1;
49 |, $temp, $class );
50 3 ▶ eval $c;
Subroutine BEGIN: called CC=1 SCAR=0.0
Subroutine BEGIN: called CC=1 SCAR=0.0
51 3 return $temp;
52 }
53  
54 3 1;
« ODS/Storage/File/JSON.pm ↑ Summary ODS/Table/Column/Epoch.pm »