DBIx/Class/CDBICompat/GetSet.pm

filter: Statementstmt 41.1% 7 / 17 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 50.0% 2 / 4 Podpod 0.0% 0 / 2 totaltotal 33.3% 9 / 27 CC 4 SCAR 19.7
CC
4
Cov
33%
set
12.0
get
6.0
BEGIN
1.0
CRAP 7.1
« DBIx/Class/ResultClass/HashRefInflator.pm ↑ Summary DBIx/Class/Storage/DBI/mysql.pm »
1 package # hide from PAUSE
2 DBIx::Class::CDBICompat::GetSet;
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  
7 0 ▶sub get {
Subroutine get: not called CC=2 SCAR=17.9
Pod undocumented
8 0 my ($self, @cols) = @_;
9 0 ▶ if (@cols > 1) {
Branch: 1 branch
BranchTrueFalseTotal
if (@cols > 1) { } 0 0 0
10 0 return map { $self->get_column($_) } @cols;
11 } else {
12 0 return $self->get_column($_[1]);
13 }
14 }
15  
16 0 ▶sub set {
Subroutine set: not called CC=3 SCAR=24.8
Pod undocumented
17 0 my($self, %data) = @_;
18  
19 # set_columns() is going to do a string comparison before setting.
20 # This breaks on DateTime objects (whose comparison is arguably broken)
21 # so we stringify anything first.
22 0 for my $key (keys %data) {
23 0 ▶ next unless ref $data{$key};
Branch: 1 branch
BranchTrueFalseTotal
unless ref $data{$key} 0 0 0
24 0 $data{$key} = "$data{$key}";
25 }
26  
27 0 return shift->set_columns(\%data);
28 }
29  
30 2 1;
« DBIx/Class/ResultClass/HashRefInflator.pm ↑ Summary DBIx/Class/Storage/DBI/mysql.pm »