Object/Metadata/Column/Timestamp.pm

filter: Statementstmt 61.7% 21 / 34 Branchbran 0.0% 0 / 10 Conditioncond 0.0% 0 / 15 MC/DCmcdc 0.0% 0 / 8 Subroutinesub 66.6% 6 / 9 Podpod 100% 4 / 4 totaltotal 38.7% 31 / 80 CC 11 SCAR 32.5
CC
11
Cov
36%
parse_value
56.0
should_inline_value
18.4
format_value
2.0
CRAP 25.9
« Object/Util.pm ↑ Summary Object/Metadata/Column/Date.pm »
1 package Rose::DB::Object::Metadata::Column::Timestamp;
2  
3 4 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 4 ▶use Rose::DateTime::Util;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 4 ▶use Rose::DB::Object::MakeMethods::Date;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 4 ▶use Rose::DB::Object::Metadata::Column::Date;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 4 our @ISA = qw(Rose::DB::Object::Metadata::Column::Date);
10  
11 4 our $VERSION = '0.788';
12  
13 4 foreach my $type (__PACKAGE__->available_method_types)
14 {
15 12 __PACKAGE__->method_maker_type($type => 'timestamp');
16 }
17  
18 9 ▶sub type { 'timestamp' }
Subroutine type: called CC=1 SCAR=0.0
Pod documented
19  
20 sub should_inline_value
21 0 ▶{
Subroutine should_inline_value: not called CC=5 SCAR=29.1
Pod documented
22 0 my($self, $db, $value) = @_;
23 4 ▶ no warnings 'uninitialized';
Subroutine BEGIN: called CC=1 SCAR=0.0
24 0 ▶ return (($db->validate_timestamp_keyword($value) && $db->should_inline_timestamp_keyword($value)) ||
Branch: 1 branch
BranchTrueFalseTotal
$db->validate_timestamp_keyword($value) && $db->should_inline_timestamp_keyword($value) || $db->keyword_function_calls && $value =~ /^\w+\(.*\)$/ ? : 0 0 0
Condition0%0/9
$db->validate_timestamp_keyword($value) and $db->should_inline_timestamp_keyword($value) or $db->keyword_function_calls and $value =~ /^\w+\(.*\)$/
l!l&&r!l&&!r
000
$db->validate_timestamp_keyword($value) and $db->should_inline_timestamp_keyword($value)
!ll&&!rl&&r
000
$db->keyword_function_calls and $value =~ /^\w+\(.*\)$/
!ll&&!rl&&r
000
MC/DC0%0/4
$db->validate_timestamp_keyword($value) and $db->should_inline_timestamp_keyword($value) or $db->keyword_function_calls and $value =~ /^\w+\(.*\)$/
$db->validate_timestamp_keyword($value) $db->should_inline_timestamp_keyword($value) $db->keyword_function_calls $value =~ /^\w+\(.*\)$/
Truth table0%0/7
A and B or C and D
A= $db->validate_timestamp_keyword($value)B= $db->should_inline_timestamp_keyword($value)C= $db->keyword_function_callsD= $value =~ /^\w+\(.*\)$/
ABCDresult
11XX1
0X111
10111
0X0X0
0X100
100X0
10100
25 ($db->keyword_function_calls && $value =~ /^\w+\(.*\)$/)) ? 1 : 0;
26 }
27  
28 sub parse_value
29 0 ▶{
Subroutine parse_value: not called CC=7 SCAR=40.3
Pod documented
30 0 my($self, $db) = (shift, shift);
31  
32 0 $self->parse_error(undef);
33  
34 0 my $dt = $db->parse_timestamp(@_);
35  
36 0 ▶ if($dt)
Branch: 1 branch
BranchTrueFalseTotal
if ($dt) { } 0 0 0
37 {
38 0 ▶ $dt->set_time_zone($self->time_zone || $db->server_time_zone)
Branch: 1 branch
BranchTrueFalseTotal
if UNIVERSAL::isa($dt, "DateTime") 0 0 0
Condition0%0/3
$self->time_zone || $db->server_time_zone
l!l&&r!l&&!r
000
MC/DC0%0/2
$self->time_zone || $db->server_time_zone
$self->time_zone $db->server_time_zone
Truth table0%0/3
A || B
A= $self->time_zoneB= $db->server_time_zone
ABresult
1X1
011
000
39 if(UNIVERSAL::isa($dt, 'DateTime'));
40 }
41 else
42 {
43 0 ▶ $dt = Rose::DateTime::Util::parse_date($_[0], $self->time_zone || $db->server_time_zone);
Condition0%0/3
$self->time_zone || $db->server_time_zone
l!l&&r!l&&!r
000
MC/DC0%0/2
$self->time_zone || $db->server_time_zone
$self->time_zone $db->server_time_zone
Truth table0%0/3
A || B
A= $self->time_zoneB= $db->server_time_zone
ABresult
1X1
011
000
44  
45 0 ▶ if(my $error = Rose::DateTime::Util->error)
Branch: 1 branch
BranchTrueFalseTotal
if (my $error = "Rose::DateTime::Util"->error) 0 0 0
46 {
47 0 ▶ $self->parse_error("Could not parse value '$_[0]' for column $self: $error")
Branch: 1 branch
BranchTrueFalseTotal
if defined $_[0] 0 0 0
48 if(defined $_[0]);
49 }
50 }
51  
52 0 return $dt;
53 }
54  
55 0 ▶sub format_value { shift; shift->format_timestamp(@_) }
Subroutine format_value: not called CC=1 SCAR=6.9
Pod documented
56  
57 4 1;
58  
59 __END__
« Object/Util.pm ↑ Summary Object/Metadata/Column/Date.pm »