MoCo/Column/UTCDateTime.pm

filter: Statementstmt 100% 23 / 23 Branchbran 66.6% 4 / 6 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 6 / 6 Podpod 0.0% 0 / 2 totaltotal 89.1% 33 / 37 CC 4 SCAR 6.4
CC
4
Cov
93%
UTCDateTime
3.0
UTCDateTime_as_string
2.0
BEGIN
1.0
CRAP 1.9
« MoCo/Column/DateTime.pm ↑ Summary MoCo/Column.pm »
1 package DBIx::MoCo::Column::UTCDateTime;
2 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use DateTime;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 1 ▶use DateTime::Format::MySQL;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 4 ▶sub UTCDateTime {
Subroutine UTCDateTime: called CC=3 SCAR=11.0
Pod undocumented
8 4 my $self = shift;
9 4 ▶ return if not $$self;
Branch: 1 branch
BranchTrueFalseTotal
unless $$self 1 3 4
10 3 ▶ return if $$self =~ /0000/o;
Branch: 1 branch
BranchTrueFalseTotal
if $$self =~ /0000/o 0 3 3
11 3 my $dt = DateTime::Format::MySQL->parse_datetime($$self);
12 3 $dt->set_time_zone('UTC');
13 3 return $dt;
14 }
15  
16 2 ▶sub UTCDateTime_as_string {
Subroutine UTCDateTime_as_string: called CC=2 SCAR=7.0
Pod undocumented
17 2 my $class = shift;
18 2 ▶ my $dt = shift or return;
Branch: 1 branch
BranchTrueFalseTotal
my $dt = shift() or return 2 0 2
19 2 $dt->set_time_zone('UTC');
20 2 return DateTime::Format::MySQL->format_datetime($dt);
21 }
22  
23 1 1;
« MoCo/Column/DateTime.pm ↑ Summary MoCo/Column.pm »