blib/lib/WebService/Bugzilla/Field.pm

filter: Statementstmt 44.6% 21 / 47 Branchbran 0.0% 0 / 4 Conditioncond 0.0% 0 / 9 MC/DCmcdc 0.0% 0 / 5 Subroutinesub 50.0% 3 / 6 Podpod 100% 3 / 3 totaltotal 36.4% 27 / 74 CC 7 SCAR 23.9
CC
7
Cov
35%
get_field
20.0
get
12.0
legal_values
6.0
CRAP 10.9
« blib/lib/WebService/Bugzilla/Bug.pm ↑ Summary blib/lib/WebService/Bugzilla/BugUserLastVisit.pm »
1 #!/usr/bin/false
2 # ABSTRACT: Bugzilla Field object and service
3 # PODNAME: WebService::Bugzilla::Field
4  
5 package WebService::Bugzilla::Field 0.001;
6 1 ▶use strictures 2;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 1 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 1 ▶use namespace::clean;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 1 extends 'WebService::Bugzilla::Object';
11  
12 1 has display_name => (is => 'ro');
13 1 has is_custom => (is => 'ro');
14 1 has is_mandatory => (is => 'ro');
15 1 has is_on_bug_entry => (is => 'ro');
16 1 has name => (is => 'ro');
17 1 has type => (is => 'ro');
18 1 has value_field => (is => 'ro');
19 1 has values => (is => 'ro');
20 1 has visibility_field => (is => 'ro');
21 1 has visibility_values => (is => 'ro');
22  
23 0 ▶sub get {
Subroutine get: not called CC=3 SCAR=24.8
Pod documented
24 0 my ($self) = @_;
25 0 require WebService::Bugzilla::Field::Value;
26 0 my $res = $self->client->get($self->_mkuri('field/bug'));
27 return [
28 map {
29 0 my $f = $_;
30 $self->new(
31 client => $self->client,
32 0 %{ $f },
33 values => [
34 0 map { WebService::Bugzilla::Field::Value->new(%{$_}) }
35 0 ▶ @{ $f->{values} // [] }
Condition0%0/2
$f->{"values"} // []
l!l
00
MC/DC0%0/1
$f->{"values"} // []
$f->{"values"}
Truth table0%0/2
A
A= $f->{"values"}
Aresult
11
00
36 ],
37 )
38 }
39 0 ▶ @{ $res->{fields} // [] }
Condition0%0/2
$res->{"fields"} // []
l!l
00
MC/DC0%0/1
$res->{"fields"} // []
$res->{"fields"}
Truth table0%0/2
A
A= $res->{"fields"}
Aresult
11
00
40 ];
41 }
42  
43 0 ▶sub get_field {
Subroutine get_field: not called CC=4 SCAR=30.0
Pod documented
44 0 my ($self, $id_or_name) = @_;
45 0 require WebService::Bugzilla::Field::Value;
46 0 my $res = $self->client->get($self->_mkuri("field/bug/$id_or_name"));
47 0 ▶ return unless $res->{fields} && @{ $res->{fields} };
Branch: 1 branch
BranchTrueFalseTotal
unless $res->{"fields"} and @{$res->{"fields"};} 0 0 0
Condition0%0/3
$res->{"fields"} and @{$res->{"fields"};}
!ll&&!rl&&r
000
MC/DC0%0/2
$res->{"fields"} and @{$res->{"fields"};}
$res->{"fields"} @{$res->{"fields"};}
Truth table0%0/3
A and B
A= $res->{"fields"}B= @{$res->{"fields"};}
ABresult
0X0
100
111
48 0 my $f = $res->{fields}[0];
49 return $self->new(
50 client => $self->client,
51 0 %{ $f },
52 values => [
53 0 map { WebService::Bugzilla::Field::Value->new(%{$_}) }
54 0 ▶ @{ $f->{values} // [] }
Condition0%0/2
$f->{"values"} // []
l!l
00
MC/DC0%0/1
$f->{"values"} // []
$f->{"values"}
Truth table0%0/2
A
A= $f->{"values"}
Aresult
11
00
55 ],
56 );
57 }
58  
59 0 ▶sub legal_values {
Subroutine legal_values: not called CC=2 SCAR=17.9
Pod documented
60 0 my ($self, $field, $product_id) = @_;
61 0 ▶ my $path = defined $product_id
Branch: 1 branch
BranchTrueFalseTotal
defined $product_id ? : 0 0 0
62 ? "field/bug/$field/$product_id/values"
63 : "field/bug/$field/values";
64 0 my $res = $self->client->get($self->_mkuri($path));
65 0 return $res->{values};
66 }
67  
68 1 1;
69  
70 __END__
« blib/lib/WebService/Bugzilla/Bug.pm ↑ Summary blib/lib/WebService/Bugzilla/BugUserLastVisit.pm »