blib/lib/DBIO/MySQL/Introspect/Util.pm

filter: Statementstmt 100% 15 / 15 Branchbran 66.6% 4 / 6 Conditioncond 40.0% 2 / 5 MC/DCmcdc 0.0% 0 / 3 Subroutinesub 100% 4 / 4 Podpod 100% 2 / 2 totaltotal 77.1% 27 / 35 CC 6 SCAR 11.7
CC
6
Cov
81%
column_size
4.2
keep_table
3.3
BEGIN
1.0
CRAP 3.2
« blib/lib/DBIO/MySQL/Introspect/ForeignKeys.pm ↑ Summary blib/lib/DBIO/MySQL/Test/EventTZ.pm »
1 package DBIO::MySQL::Introspect::Util;
2 # ABSTRACT: Shared helpers for the MySQL/MariaDB introspect submodules
3  
4 46 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 46 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 46 our $VERSION = '0.900007';
8  
9  
10  
11 89 ▶sub keep_table {
Subroutine keep_table: called CC=3 SCAR=12.0
Pod documented
12 89 my ($class, $tables, $name) = @_;
13 89 ▶ return exists $tables->{ $name // '' } ? 1 : 0;
Branch: 1 branch
BranchTrueFalseTotal
exists $$tables{$name // ''} ? : 89 0 89
Condition50%1/2
$name // ""
l!l
890
MC/DC0%0/1
$name // ""
$name
Truth table50%1/2
A
A= $name
Aresult
11
00
14 }
15  
16  
17 78 ▶sub column_size {
Subroutine column_size: called CC=4 SCAR=14.5
Pod documented
18 78 my ($class, $column_type) = @_;
19 78 ▶ return undef unless defined $column_type && length $column_type;
Branch: 1 branch
BranchTrueFalseTotal
unless defined $column_type and length $column_type 0 78 78
Condition33%1/3
defined $column_type and length $column_type
!ll&&!rl&&r
0078
MC/DC0%0/2
defined $column_type and length $column_type
defined $column_type length $column_type
Truth table33%1/3
A and B
A= defined $column_typeB= length $column_type
ABresult
0X0
100
111
20 78 ▶ if ($column_type =~ /^\w+\s*\(\s*(\d+)/) {
Branch: 1 branch
BranchTrueFalseTotal
if ($column_type =~ /^\w+\s*\(\s*(\d+)/) 46 32 78
21 46 return $1 + 0; # numericify
22 }
23 32 return undef;
24 }
25  
26 46 1;
27  
28 __END__
« blib/lib/DBIO/MySQL/Introspect/ForeignKeys.pm ↑ Summary blib/lib/DBIO/MySQL/Test/EventTZ.pm »