Script/Index.pm

filter: Statementstmt 20.8% 5 / 24 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 50.0% 1 / 2 Podpod 100% 1 / 1 totaltotal 24.1% 7 / 29 CC 2 SCAR 14.7
CC
2
Cov
19%
create_index
6.0
BEGIN
1.0
CRAP 4.3
« Script/Sql.pm ↑ Summary Base/Common.pm »
1 package Daje::Workflow::GenerateSQL::Script::Index;
2 1 ▶use Mojo::Base 'Daje::Workflow::GenerateSQL::Base::Common', -base, -signatures;
Subroutine BEGIN: called CC=1 SCAR=0.0
3  
4 1 has 'tablename' => "";
5  
6 0 ▶sub create_index($self) {
Subroutine create_index: not called CC=2 SCAR=17.9
Pod documented
7 0 my $sql = "";
8 0 my $json = $self->json->{index};
9 0 my $length = scalar @{$json};
10 0 ▶ for (my $i = 0; $i < $length; $i++) {
Branch: 1 branch
BranchTrueFalseTotal
if ($i < $length) 0 0 0
11 0 my $template = $self->templates->get_data_section('index');
12 0 my $table_name = $self->tablename;
13 0 $template =~ s/<<table>>/$table_name/ig;
14 0 $template =~ s/<<type>>/@{$json}[$i]->{type}/ig;
15 0 $template =~ s/<<fields>>/@{$json}[$i]->{fields}/ig;
16 0 @{$json}[$i]->{fields} =~ s/,/_/ig;
17 0 $template =~ s/<<field_names>>/@{$json}[$i]->{fields}/ig;
18 0 $sql .= $template . "";
19 }
20 0 $self->set_sql($sql);
21 0 return;
22 }
23  
24 1 1;
25  
26  
27  
28  
29  
30 #################### pod generated by Pod::Autopod - keep this line to make pod updates possible ####################
31  
32 =head1 NAME
33  
34 Daje::Workflow::GenerateSQL::Script::Index
35  
36  
37 =head1 DESCRIPTION
38  
39 pod generated by Pod::Autopod - keep this line to make pod updates possible ####################
40  
41  
42 =head1 REQUIRES
43  
44 L<Mojo::Base>
45  
46  
47 =head1 METHODS
48  
49 =head2 create_index($self)
50  
51 create_index($self)();
52  
53  
54 =cut
55  
« Script/Sql.pm ↑ Summary Base/Common.pm »