| 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
| |||||||||||||||||||||||||||||||||
| 21 | |||||||||||||||||||||||||||||||||
| 22 | 0 | ▶ | my $indexvalues = ref $info->{'indexed'} ne 'ARRAY' ? [ $info->{'indexed'} ] : $info->{'indexed'}; | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 23 | |||||||||||||||||||||||||||||||||
| 24 | 0 | for my $indexvalue (@$indexvalues) { | |||||||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||||||
| 26 | 0 | ▶ | if(length $indexvalue == 1 && $indexvalue) { | ||||||||||||||||||||||||||||||
|
Branch: 2 branches
Condition0%0/3
length $indexvalue == 1 and $indexvalue
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
| |||||||||||||||||||||||||||||||||
| 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
| |||||||||||||||||||||||||||||||||
| 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
| |||||||||||||||||||||||||||||||||
| 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
| |||||||||||||||||||||||||||||||||
| 48 | } | ||||||||||||||||||||||||||||||||
| 49 | |||||||||||||||||||||||||||||||||
| 50 | 2 | 1; | |||||||||||||||||||||||||||||||
| 51 | |||||||||||||||||||||||||||||||||
| 52 | __END__ | ||||||||||||||||||||||||||||||||