| 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"} // []
MC/DC0%0/1
$f->{"values"} // []
$f->{"values"}
Truth table0%0/2
A
A= $f->{"values"}
| |||||||||||||||||||||||||||||
| 36 | ], | ||||||||||||||||||||||||||||
| 37 | ) | ||||||||||||||||||||||||||||
| 38 | } | ||||||||||||||||||||||||||||
| 39 | 0 | ▶ | @{ $res->{fields} // [] } | ||||||||||||||||||||||||||
|
Condition0%0/2
$res->{"fields"} // []
MC/DC0%0/1
$res->{"fields"} // []
$res->{"fields"}
Truth table0%0/2
A
A= $res->{"fields"}
| |||||||||||||||||||||||||||||
| 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
Condition0%0/3
$res->{"fields"} and @{$res->{"fields"};}
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"};}
| |||||||||||||||||||||||||||||
| 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"} // []
MC/DC0%0/1
$f->{"values"} // []
$f->{"values"}
Truth table0%0/2
A
A= $f->{"values"}
| |||||||||||||||||||||||||||||
| 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
| |||||||||||||||||||||||||||||
| 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__ | ||||||||||||||||||||||||||||