Smooth/ResultBase.pm

filter: Statementstmt 48.5% 17 / 35 Branchbran 0.0% 0 / 14 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 83.3% 5 / 6 Podpod 0.0% 0 / 1 totaltotal 36.0% 22 / 61 CC 12 SCAR 47.0
CC
12
Cov
33%
sqlt_deploy_hook
156.0
BEGIN
1.0
BEGIN
1.0
CRAP 110.4
« Smooth/Helper/ResultSet/Shortcut/RemoveColumns.pm ↑ Summary Smooth/ResultSetBase.pm »
1 2 ▶use 5.20.0;
Subroutine BEGIN: called CC=1 SCAR=0.0
2 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 package DBIx::Class::Smooth::ResultBase;
6  
7 # ABSTRACT: Short intro
8 2 our $AUTHORITY = 'cpan:CSSON'; # AUTHORITY
9 2 our $VERSION = '0.0108';
10  
11 2 ▶use parent 'DBIx::Class::Core';
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 2 ▶use experimental qw/signatures/;
Subroutine BEGIN: called CC=1 SCAR=0.0
14  
15 0 ▶sub sqlt_deploy_hook($self, $table) {
Subroutine sqlt_deploy_hook: not called CC=12 SCAR=50.5
Pod undocumented
16 0 my $indices = {};
17 0 for my $column_name ($self->columns) {
18 0 my $info = $self->column_info($column_name);
19  
20 0 ▶ if($info->{'indexed'}) {
Branch: 1 branch
BranchTrueFalseTotal
if ($info->{"indexed"}) 0 0 0
21  
22 0 ▶ my $indexvalues = ref $info->{'indexed'} ne 'ARRAY' ? [ $info->{'indexed'} ] : $info->{'indexed'};
Branch: 1 branch
BranchTrueFalseTotal
ref $info->{'indexed'} ne 'ARRAY' ? : 0 0 0
23  
24 0 for my $indexvalue (@$indexvalues) {
25  
26 0 ▶ if(length $indexvalue == 1 && $indexvalue) {
Branch: 2 branches
BranchTrueFalseTotal
if (length $indexvalue == 1 and $indexvalue) { } 0 0 0
elsif (length $indexvalue > 1) { } 0 0 0
Condition0%0/3
length $indexvalue == 1 and $indexvalue
!ll&&!rl&&r
000
MC/DC0%0/2
length $indexvalue == 1 and $indexvalue
length $indexvalue == 1 $indexvalue
Truth table0%0/3
A and B
A= length $indexvalue == 1B= $indexvalue
ABresult
0X0
100
111
27 0 my $index_name = sprintf '%s_idxa_%s', $table, $column_name;
28 0 $indices->{ $index_name } = [$column_name];
29 }
30 elsif(length $indexvalue > 1) {
31 0 my $index_name = sprintf '%s_idxm_%s', $table, $indexvalue;
32  
33 0 ▶ if(!exists $indices->{ $index_name }) {
Branch: 1 branch
BranchTrueFalseTotal
unless (exists $indices->{$index_name}) 0 0 0
34 0 $indices->{ $index_name } = [];
35 }
36 0 push @{ $indices->{ $index_name } } => $column_name;
37 }
38 }
39 }
40 }
41  
42 0 ▶ if(scalar keys %$indices) {
Branch: 1 branch
BranchTrueFalseTotal
if (scalar keys %$indices) 0 0 0
43 0 for my $index_name (keys %$indices) {
44 0 $table->add_index(name => $index_name, fields => $indices->{ $index_name });
45 }
46 }
47 0 ▶ $self->next::method(@_) if $self->next::can;
Branch: 1 branch
BranchTrueFalseTotal
if $self->next::can 0 0 0
48 }
49  
50 2 1;
51  
52 __END__
« Smooth/Helper/ResultSet/Shortcut/RemoveColumns.pm ↑ Summary Smooth/ResultSetBase.pm »