SRS/Time.pm

filter: Statementstmt 70.5% 24 / 34 Branchbran 16.6% 1 / 6 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 72.7% 8 / 11 Podpod 0.0% 0 / 1 totaltotal 63.4% 33 / 52 CC 4 SCAR 9.8
CC
4
Cov
62%
__ANON__
6.0
buildargs_time
6.0
__ANON__
2.1
CRAP 2.7
« SRS/Date.pm ↑ Summary SRS/Keyring.pm »
1  
2 package XML::SRS::Time;
3 6 ▶BEGIN {
Subroutine BEGIN: called CC=1 SCAR=0.0
4 6 $XML::SRS::Time::VERSION = '0.09';
5 }
6  
7 6 ▶use Moose::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 6 ▶use PRANG::Graph;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 6 ▶use Moose::Util::TypeConstraints;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 6 ▶use MooseX::Params::Validate;
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12 6 ▶BEGIN{
Subroutine BEGIN: called CC=1 SCAR=0.7
13 subtype 'XML::SRS::Time::Hour'
14 => as "Int",
15 0 ▶ => where {
Subroutine __ANON__: not called CC=2 SCAR=17.9
16 0 ▶ $_ >= 0 and $_ <= 23;
Branch: 1 branch
BranchTrueFalseTotal
$_ >= 0 and $_ <= 23 0 0 0
17 6 };
18 subtype 'XML::SRS::Time::Sexagesimal'
19 => as "Int",
20 6 ▶ => where {
Subroutine __ANON__: called CC=2 SCAR=7.6
21 6 ▶ $_ >= 0 and $_ <= 59;
Branch: 1 branch
BranchTrueFalseTotal
$_ >= 0 and $_ <= 59 6 0 6
22 6 };
23 subtype 'XML::SRS::Time::TZOffset'
24 => as "Str",
25 2 ▶ => where {
Subroutine __ANON__: called CC=1 SCAR=0.0
26 2 m{^[-+][\s\d]?\d(?::?\d\d)?$};
27  
28 6 };
29  
30 subtype 'XML::SRS::Time::hms'
31 => as "Str",
32 0 ▶ => where {
Subroutine __ANON__: not called CC=1 SCAR=6.9
33 0 m{^(\d{1,2}):(\d{1,2}):(\d{1,2})$};
34 6 };
35 }
36  
37 0 ▶sub buildargs_time {
Subroutine buildargs_time: not called CC=2 SCAR=17.9
Pod undocumented
38 0 my $inc = shift;
39 0 my ( $hms, $offset ) = pos_validated_list(
40 \@_,
41 { isa => 'XML::SRS::Time::hms' },
42 { isa => 'Maybe[XML::SRS::Time::TZOffset]', optional => 1 },
43 );
44
45 0 my @buildargs;
46 0 ▶ if (defined $offset) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $offset) 0 0 0
47 0 push @buildargs, tz_offset => $offset;
48 }
49 0 my ($h, $m, $s) = split ":", $hms;
50 0 push @buildargs, hour => $h, minute => $m, second => $s;
51 0 @buildargs;
52 }
53  
54 6 has_attr 'hour' =>
55 is => "rw",
56 isa => "XML::SRS::Time::Sexagesimal",
57 required => 1,
58 xml_name => "Hour",
59 ;
60  
61 6 has_attr 'minute' =>
62 is => "rw",
63 isa => "XML::SRS::Time::Sexagesimal",
64 required => 1,
65 xml_name => "Minute",
66 ;
67  
68 6 has_attr 'second' =>
69 is => "rw",
70 isa => "XML::SRS::Time::Sexagesimal",
71 xml_name => "Second",
72 ;
73  
74 6 has_attr 'tz_offset' =>
75 is => "rw",
76 isa => "XML::SRS::Time::TZOffset",
77 xml_required => 0,
78 clearer => "make_floating",
79 xml_name => "TimeZoneOffset",
80 ;
81  
82 6 1;
« SRS/Date.pm ↑ Summary SRS/Keyring.pm »