DBIx/Class/Storage/DBI/ADO/CursorUtils.pm

filter: Statementstmt 52.3% 11 / 21 Branchbran 0.0% 0 / 12 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 60.0% 3 / 5 Podpod n/a totaltotal 36.8% 14 / 38 CC 9 SCAR 31.5
CC
9
Cov
33%
_strip_trailing_binary_nulls
30.0
_normalize_guids
30.0
BEGIN
1.0
CRAP 23.3
« DBIx/Class/CDBICompat/ColumnGroups.pm ↑ Summary DBIx/Class/CDBICompat/LazyLoading.pm »
1 package # hide from PAUSE
2 DBIx::Class::Storage::DBI::ADO::CursorUtils;
3  
4 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 2 ▶use base 'Exporter';
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 2 our @EXPORT_OK = qw/_normalize_guids _strip_trailing_binary_nulls/;
9  
10 0 ▶sub _strip_trailing_binary_nulls {
Subroutine _strip_trailing_binary_nulls: not called CC=5 SCAR=34.0
11 0 my ($select, $col_infos, $data, $storage) = @_;
12  
13 0 foreach my $select_idx (0..$#$select) {
14  
15 0 ▶ next unless defined $data->[$select_idx];
Branch: 1 branch
BranchTrueFalseTotal
unless defined $data->[$select_idx] 0 0 0
16  
17 my $data_type = $col_infos->{$select->[$select_idx]}{data_type}
18 0 ▶ or next;
Branch: 1 branch
BranchTrueFalseTotal
my $data_type = $$col_infos{$select->[$select_idx]}{"data_type"} or next 0 0 0
19  
20 0 ▶ $data->[$select_idx] =~ s/\0+\z//
Branch: 1 branch
BranchTrueFalseTotal
if $storage->_is_binary_type($data_type) 0 0 0
21 if $storage->_is_binary_type($data_type);
22 }
23 }
24  
25 0 ▶sub _normalize_guids {
Subroutine _normalize_guids: not called CC=5 SCAR=34.0
26 0 my ($select, $col_infos, $data, $storage) = @_;
27  
28 0 foreach my $select_idx (0..$#$select) {
29  
30 0 ▶ next unless defined $data->[$select_idx];
Branch: 1 branch
BranchTrueFalseTotal
unless defined $data->[$select_idx] 0 0 0
31  
32 my $data_type = $col_infos->{$select->[$select_idx]}{data_type}
33 0 ▶ or next;
Branch: 1 branch
BranchTrueFalseTotal
my $data_type = $$col_infos{$select->[$select_idx]}{"data_type"} or next 0 0 0
34  
35 0 ▶ $data->[$select_idx] =~ s/\A \{ (.+) \} \z/$1/xs
Branch: 1 branch
BranchTrueFalseTotal
if $storage->_is_guid_type($data_type) 0 0 0
36 if $storage->_is_guid_type($data_type);
37 }
38 }
39  
40 2 1;
41  
42 # vim:sts=2 sw=2:
« DBIx/Class/CDBICompat/ColumnGroups.pm ↑ Summary DBIx/Class/CDBICompat/LazyLoading.pm »