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/Storage/TxnScopeGuard.pm ↑ Summary DBIx/Class/Storage/DBI/mysql.pm »
1 package # hide from PAUSE
2 DBIx::Class::CDBICompat::GetSet;
3  
4 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 #use base qw/Class::Accessor/;
8  
9 sub get {
10 0 ▶ my ($self, @cols) = @_;
Subroutine get: not called CC=2 SCAR=17.9
Pod undocumented
11 0 ▶ if (@cols > 1) {
Branch: 1 branch
BranchTrueFalseTotal
if (@cols > 1) { } 0 0 0
12 0 return map { $self->get_column($_) } @cols;
13 } else {
14 0 return $self->get_column($_[1]);
15 }
16 }
17  
18 sub set {
19 0 ▶ my($self, %data) = @_;
Subroutine set: not called CC=3 SCAR=24.8
Pod undocumented
20  
21 # set_columns() is going to do a string comparison before setting.
22 # This breaks on DateTime objects (whose comparison is arguably broken)
23 # so we stringify anything first.
24 0 for my $key (keys %data) {
25 0 ▶ next unless ref $data{$key};
Branch: 1 branch
BranchTrueFalseTotal
unless ref $data{$key} 0 0 0
26 0 $data{$key} = "$data{$key}";
27 }
28  
29 0 return shift->set_columns(\%data);
30 }
31  
32 1 1;
« DBIx/Class/Storage/TxnScopeGuard.pm ↑ Summary DBIx/Class/Storage/DBI/mysql.pm »