TeamCity/Entity/Project.pm

filter: Statementstmt 100% 39 / 39 Branchbran 100% 2 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 12 / 12 Podpod n/a totaltotal 100% 53 / 53 CC 2 SCAR 1.4
CC
2
Cov
100%
_build_parent_project
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.2
« TeamCity/Entity/Build.pm ↑ Summary TeamCity/Entity/BuildType.pm »
1 package WebService::TeamCity::Entity::Project;
2  
3 4 ▶use v5.10;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 4 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 4 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 4 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 4 our $VERSION = '0.04';
9  
10 4 ▶use Types::Standard qw( ArrayRef Bool InstanceOf Maybe Str );
Subroutine BEGIN: called CC=1 SCAR=0.0
11 4 ▶use WebService::TeamCity::Entity::BuildType;
Subroutine BEGIN: called CC=1 SCAR=0.0
12 4 ▶use WebService::TeamCity::Entity::Project;
Subroutine BEGIN: called CC=1 SCAR=0.0
13 4 ▶use WebService::TeamCity::Types qw( JSONBool );
Subroutine BEGIN: called CC=1 SCAR=0.0
14  
15 4 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
16  
17 4 has archived => (
18 is => 'ro',
19 isa => Bool | JSONBool,
20 default => 0,
21 );
22  
23 4 has parent_project => (
24 is => 'ro',
25 isa => Maybe [ InstanceOf [__PACKAGE__] ],
26 lazy => 1,
27 builder => '_build_parent_project',
28 );
29  
30 has child_projects => (
31 is => 'ro',
32 isa => ArrayRef [ InstanceOf [__PACKAGE__] ],
33 lazy => 1,
34 2 ▶ default => sub {
Subroutine __ANON__: called CC=1 SCAR=0.0
35 $_[0]->_inflate_array(
36 $_[0]->_full_data->{projects}{project},
37 2 'Project',
38 'parent_project',
39 );
40 },
41 4 );
42  
43 has build_types => (
44 is => 'ro',
45 isa =>
46 ArrayRef [ InstanceOf ['WebService::TeamCity::Entity::BuildType'] ],
47 lazy => 1,
48 2 ▶ default => sub {
Subroutine __ANON__: called CC=1 SCAR=0.0
49 $_[0]->_inflate_array(
50 $_[0]->_full_data->{build_types}{build_type},
51 2 'BuildType',
52 'project',
53 );
54 },
55 4 );
56  
57 # has templates => (
58 # is => 'ro',
59 # isa => ArrayRef [ InstanceOf ['WebService::TeamCity::Entity::BuildType'] ],
60 # lazy => 1,
61 # default => sub {
62 # $_[0]->_inflate_array(
63 # $_[0]->_full_data->{templates}{build_type},
64 # 'BuildType',
65 # 'project',
66 # );
67 # },
68 # );
69  
70 # has parameters => (
71 # is => 'ro',
72 # isa => ArrayRef [ InstanceOf ['WebService::TeamCity::Parameter'] ],
73 # lazy => 1,
74 # default => sub {
75 # $_[0]->_inflate_array(
76 # 'Parameter',
77 # $_[0]->_full_data->{projects}{parameters},
78 # );
79 # },
80 # );
81  
82 # has vcs_roots => (
83 # is => 'ro',
84 # isa => ArrayRef [ InstanceOf ['WebService::TeamCity::VCSRoot'] ],
85 # lazy => 1,
86 # default => sub {
87 # $_[0]->_inflate_array(
88 # 'VCSRoot',
89 # $_[0]->_full_data->{projects}{vcs_roots},
90 # );
91 # },
92 # );
93  
94 4 with(
95 'WebService::TeamCity::Entity',
96 'WebService::TeamCity::Entity::HasDescription',
97 'WebService::TeamCity::Entity::HasID',
98 'WebService::TeamCity::Entity::HasName',
99 'WebService::TeamCity::Entity::HasWebURL',
100 );
101  
102 2 ▶sub _build_parent_project {
Subroutine _build_parent_project: called CC=2 SCAR=6.9
103 2 my $self = shift;
104  
105 2 my $full_data = $self->_full_data;
106 2 ▶ return unless $full_data->{parent_project};
Branch: 1 branch
BranchTrueFalseTotal
unless $full_data->{"parent_project"} 1 1 2
107  
108 return $self->_inflate_one(
109 $full_data->{parent_project},
110 1 'Project',
111 );
112 }
113  
114 4 1;
115  
116 # ABSTRACT: A single TeamCity project
117  
118 __END__
« TeamCity/Entity/Build.pm ↑ Summary TeamCity/Entity/BuildType.pm »