blib/lib/DBIO/MySQL/IndexType.pm

filter: Statementstmt 100% 14 / 14 Branchbran 100% 6 / 6 Conditioncond 88.8% 8 / 9 MC/DCmcdc 83.3% 5 / 6 Subroutinesub 100% 3 / 3 Podpod 100% 1 / 1 totaltotal 94.8% 37 / 39 CC 7 SCAR 17.4
CC
7
Cov
97%
index_type_split
7.0
BEGIN
1.0
BEGIN
1.0
CRAP 5.7
« blib/lib/DBIO/MySQL/Util.pm ↑ Summary blib/lib/DBIO/MySQL/Adapter.pm »
1 package DBIO::MySQL::IndexType;
2 # ABSTRACT: MySQL/MariaDB CREATE INDEX class/type keyword grammar
3  
4 86 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 86 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 86 our $VERSION = '0.900007';
8  
9  
10  
11 67 ▶sub index_type_split {
Subroutine index_type_split: called CC=7 SCAR=19.5
Pod documented
12 67 my ($token) = @_;
13 67 ▶ return unless defined $token && length $token;
Branch: 1 branch
BranchTrueFalseTotal
unless defined $token and length $token 5 62 67
Condition66%2/3
defined $token and length $token
!ll&&!rl&&r
5062
MC/DC50%1/2
defined $token and length $token
defined $token length $token
Truth table66%2/3
A and B
A= defined $tokenB= length $token
ABresult
0X0
100
111
14 62 my $u = uc $token;
15 62 ▶ return ('', " USING $u") if $u eq 'BTREE' || $u eq 'HASH';
Branch: 1 branch
BranchTrueFalseTotal
if $u eq "BTREE" or $u eq "HASH" 51 11 62
Condition100%3/3
$u eq "BTREE" or $u eq "HASH"
l!l&&r!l&&!r
49211
MC/DC100%2/2
$u eq "BTREE" or $u eq "HASH"
$u eq "BTREE" $u eq "HASH"
Truth table100%3/3
A or B
A= $u eq "BTREE"B= $u eq "HASH"
ABresult
1X1
011
000
16 11 ▶ return ("$u ", '') if $u eq 'FULLTEXT' || $u eq 'SPATIAL';
Branch: 1 branch
BranchTrueFalseTotal
if $u eq "FULLTEXT" or $u eq "SPATIAL" 10 1 11
Condition100%3/3
$u eq "FULLTEXT" or $u eq "SPATIAL"
l!l&&r!l&&!r
731
MC/DC100%2/2
$u eq "FULLTEXT" or $u eq "SPATIAL"
$u eq "FULLTEXT" $u eq "SPATIAL"
Truth table100%3/3
A or B
A= $u eq "FULLTEXT"B= $u eq "SPATIAL"
ABresult
1X1
011
000
17 1 return;
18 }
19  
20 86 1;
21  
22 __END__
« blib/lib/DBIO/MySQL/Util.pm ↑ Summary blib/lib/DBIO/MySQL/Adapter.pm »