SRS/Time.pm

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