DateTimeX/Lite/Infinite.pm

filter: Statementstmt 94.0% 47 / 50 Branchbran 100% 6 / 6 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 83.3% 15 / 18 Podpod 71.4% 5 / 7 totaltotal 90.1% 73 / 81 CC 4 SCAR 3.6
CC
4
Cov
95%
set
2.0
truncate
2.0
_stringify_overload
2.0
CRAP 1.4
« DateTimeX/Lite/TimeZone/OffsetOnly.pm ↑ Summary DateTimeX/Lite/TimeZone/Catalog.pm »
1 # $Id: Infinite.pm 27589 2008-12-29 23:51:35Z daisuke $
2  
3 package DateTimeX::Lite::Infinite;
4 56 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 56 ▶use base qw(DateTimeX::Lite);
Subroutine BEGIN: called CC=1 SCAR=0.0
6 56 ▶use DateTimeX::Lite::TimeZone;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 0 ▶sub set { $_[0] }
Subroutine set: not called CC=1 SCAR=6.9
Pod documented
9 2 ▶sub set_time_zone { $_[0] }
Subroutine set_time_zone: called CC=1 SCAR=0.0
Pod documented
10 0 ▶sub truncate { $_[0] }
Subroutine truncate: not called CC=1 SCAR=6.9
Pod documented
11 2 ▶sub is_finite { 0 }
Subroutine is_finite: called CC=1 SCAR=0.0
Pod documented
12 6 ▶sub is_infinite { 1 }
Subroutine is_infinite: called CC=1 SCAR=0.0
Pod documented
13  
14 4 ▶sub _calc_local_components {
Subroutine _calc_local_components: called CC=1 SCAR=0.0
15 4 my $self = shift;
16  
17 4 my @list = qw(
18 year month day day_of_week day_of_year quarter day_of_quarter
19 hour minute second
20 );
21 4 @{ $self->{local_c} }{ @list } = (
22 ( $self->{local_rd_days} ) x 7,
23 4 ( $self->{local_rd_secs} ) x 3,
24 );
25 }
26  
27 6 ▶sub _stringify_overload {
Subroutine _stringify_overload: called CC=2 SCAR=6.9
28 6 ▶ return $_[0]->{utc_rd_days} == &DateTimeX::Lite::INFINITY ?
Branch: 1 branch
BranchTrueFalseTotal
$_[0]{'utc_rd_days'} == &DateTimeX::Lite::INFINITY ? : 3 3 6
29 (&DateTimeX::Lite::INFINITY . '') :
30 (&DateTimeX::Lite::NEG_INFINITY . '')
31 }
32  
33 2 ▶sub STORABLE_freeze { return }
Subroutine STORABLE_freeze: called CC=1 SCAR=0.0
Pod undocumented
34 0 ▶sub STORABLE_thaw { return }
Subroutine STORABLE_thaw: not called CC=1 SCAR=6.9
Pod undocumented
35  
36 package #
37 DateTimeX::Lite::Infinite::Future;
38 56 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
39 56 ▶use base qw(DateTimeX::Lite::Infinite);
Subroutine BEGIN: called CC=1 SCAR=0.0
40  
41 {
42 56 my $Pos;
43  
44 3 ▶ sub new {
Subroutine new: called CC=2 SCAR=6.9
45 3 ▶ return $Pos if $Pos;
Branch: 1 branch
BranchTrueFalseTotal
if $Pos 1 2 3
46  
47 2 my $class = shift;
48 2 $Pos = bless {
49 utc_rd_days => &DateTimeX::Lite::INFINITY,
50 utc_rd_secs => &DateTimeX::Lite::INFINITY,
51 local_rd_days => &DateTimeX::Lite::INFINITY,
52 local_rd_secs => &DateTimeX::Lite::INFINITY,
53 rd_nanosecs => &DateTimeX::Lite::INFINITY,
54 tz => DateTimeX::Lite::TimeZone->load( name => 'floating' ),
55 }, $class;
56  
57 2 $Pos->_calc_utc_rd;
58 2 $Pos->_calc_local_rd;
59 2 return $Pos;
60 }
61 }
62  
63 package #
64 56 DateTimeX::Lite::Infinite::Past;
65 56 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
66 56 ▶use base qw(DateTimeX::Lite::Infinite);
Subroutine BEGIN: called CC=1 SCAR=0.0
67  
68 {
69 56 my $Neg;
70 3 ▶ sub new {
Subroutine new: called CC=2 SCAR=6.9
71 3 ▶ return $Neg if $Neg;
Branch: 1 branch
BranchTrueFalseTotal
if $Neg 1 2 3
72  
73 2 my $class = shift;
74 2 $Neg = bless {
75 utc_rd_days => &DateTimeX::Lite::NEG_INFINITY,
76 utc_rd_secs => &DateTimeX::Lite::NEG_INFINITY,
77 local_rd_days => &DateTimeX::Lite::NEG_INFINITY,
78 local_rd_secs => &DateTimeX::Lite::NEG_INFINITY,
79 rd_nanosecs => &DateTimeX::Lite::NEG_INFINITY,
80 tz => DateTimeX::Lite::TimeZone->load( name => 'floating' ),
81 }, $class;
82  
83 2 $Neg->_calc_utc_rd;
84 2 $Neg->_calc_local_rd;
85 2 return $Neg;
86 }
87 }
88  
89 56 1;
90  
91 __END__
« DateTimeX/Lite/TimeZone/OffsetOnly.pm ↑ Summary DateTimeX/Lite/TimeZone/Catalog.pm »