Guess/Role/SQL/SQLite.pm

filter: Statementstmt 100% 11 / 11 Branchbran 80.0% 8 / 10 Conditioncond 66.6% 2 / 3 MC/DCmcdc 50.0% 1 / 2 Subroutinesub 100% 2 / 2 Podpod 0.0% 0 / 1 totaltotal 82.7% 24 / 29 CC 7 SCAR 18.6
CC
7
Cov
88%
to_sql
7.2
BEGIN
1.0
CRAP 6.4
« Guess/Role/SQL/Pg.pm ↑ Summary Guess.pm »
1 package Type::Guess::Role::SQL::SQLite;
2  
3 1 ▶use Moo::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 11 ▶sub to_sql {
Subroutine to_sql: called CC=7 SCAR=19.7
Pod undocumented
6 11 my $self = shift;
7 11 ▶ my $type = ref $self->type ? $self->type->name : $self->type;
Branch: 1 branch
BranchTrueFalseTotal
ref $self->type ? : 0 11 11
8 11 ▶ return "INTEGER" if $type eq "Int";
Branch: 1 branch
BranchTrueFalseTotal
if $type eq "Int" 4 7 11
9 7 ▶ return "DATETIME" if $self->type eq 'DateTime';
Branch: 1 branch
BranchTrueFalseTotal
if $self->type eq "DateTime" 0 7 7
10 7 ▶ return "FLOAT" if $type eq "Num";
Branch: 1 branch
BranchTrueFalseTotal
if $type eq "Num" 2 5 7
11 5 ▶ return sprintf "VARCHAR(%d)", $self->length if $type eq "Str" && $self->length < 1024;
Branch: 1 branch
BranchTrueFalseTotal
if $type eq "Str" and $self->length < 1024 4 1 5
Condition66%2/3
$type eq "Str" and $self->length < 1024
!ll&&!rl&&r
014
MC/DC50%1/2
$type eq "Str" and $self->length < 1024
$type eq "Str" $self->length < 1024
Truth table66%2/3
A and B
A= $type eq "Str"B= $self->length < 1024
ABresult
0X0
100
111
12 1 return "TEXT";
13 }
14  
15 1 1;
16  
17 __DATA__
« Guess/Role/SQL/Pg.pm ↑ Summary Guess.pm »