blib/lib/WebService/Bugzilla/Role/Updatable.pm

filter: Statementstmt 61.1% 11 / 18 Branchbran 0.0% 0 / 2 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 75.0% 3 / 4 Podpod 100% 1 / 1 totaltotal 50.0% 15 / 30 CC 3 SCAR 18.7
CC
3
Cov
48%
update
12.0
BEGIN
1.0
BEGIN
1.0
CRAP 6.5
« blib/lib/WebService/Bugzilla/Comment.pm ↑ Summary blib/lib/WebService/Bugzilla/Classification.pm »
1 #!/usr/bin/false
2 # ABSTRACT: Role providing update method for Bugzilla API objects
3 # PODNAME: WebService::Bugzilla::Role::Updatable
4  
5 package WebService::Bugzilla::Role::Updatable 0.001;
6 6 ▶use strictures 2;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 6 ▶use Moo::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 6 ▶use namespace::clean;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 6 requires '_unwrap_key';
11  
12 0 ▶sub update {
Subroutine update: not called CC=3 SCAR=24.8
Pod documented
13 0 my $self = shift;
14 0 my $key = $self->_unwrap_key;
15 0 (my $resource = $key) =~ s{s$}{};
16 my $id = ($self->_api_data && defined $self->_api_data->{id})
17 ? $self->_api_data->{id}
18 0 ▶ : shift;
Branch: 1 branch
BranchTrueFalseTotal
$self->_api_data && defined $self->_api_data->{'id'} ? : 0 0 0
Condition0%0/3
$self->_api_data and defined $self->_api_data->{"id"}
!ll&&!rl&&r
000
MC/DC0%0/2
$self->_api_data and defined $self->_api_data->{"id"}
$self->_api_data defined $self->_api_data->{"id"}
Truth table0%0/3
A and B
A= $self->_api_dataB= defined $self->_api_data->{"id"}
ABresult
0X0
100
111
19 0 my %params = @_;
20 0 my $res = $self->client->put($self->_mkuri("$resource/$id"), \%params);
21 return $self->new(
22 client => $self->client,
23 0 _data => $res->{$key}[0],
24 );
25 }
26  
27 6 1;
28  
29 __END__
« blib/lib/WebService/Bugzilla/Comment.pm ↑ Summary blib/lib/WebService/Bugzilla/Classification.pm »