| 1 | #!/usr/bin/false | ||||||||||||||||||||||||||||
| 2 | # ABSTRACT: Bugzilla BugUserLastVisit object and service | ||||||||||||||||||||||||||||
| 3 | # PODNAME: WebService::Bugzilla::BugUserLastVisit | ||||||||||||||||||||||||||||
| 4 | |||||||||||||||||||||||||||||
| 5 | package WebService::Bugzilla::BugUserLastVisit 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 bug_id => (is => 'ro'); | |||||||||||||||||||||||||||
| 13 | 1 | has last_visit_ts => (is => 'ro'); | |||||||||||||||||||||||||||
| 14 | |||||||||||||||||||||||||||||
| 15 | 0 | ▶ | sub get { | ||||||||||||||||||||||||||
|
Subroutine
get: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||||||||||||||||||
| 16 | 0 | my ($self, %params) = @_; | |||||||||||||||||||||||||||
| 17 | 0 | my $res = $self->client->get($self->_mkuri('bug_user_last_visit'), \%params); | |||||||||||||||||||||||||||
| 18 | return [ | ||||||||||||||||||||||||||||
| 19 | map { | ||||||||||||||||||||||||||||
| 20 | $self->new( | ||||||||||||||||||||||||||||
| 21 | client => $self->client, | ||||||||||||||||||||||||||||
| 22 | 0 | %{ $_ } | |||||||||||||||||||||||||||
| 23 | ) | ||||||||||||||||||||||||||||
| 24 | } | ||||||||||||||||||||||||||||
| 25 | 0 | ▶ | @{ $res // [] } | ||||||||||||||||||||||||||
|
Condition0%0/2
$res // []
MC/DC0%0/1
$res // []
$res
Truth table0%0/2
A
A= $res
| |||||||||||||||||||||||||||||
| 26 | ]; | ||||||||||||||||||||||||||||
| 27 | } | ||||||||||||||||||||||||||||
| 28 | |||||||||||||||||||||||||||||
| 29 | 0 | ▶ | sub get_bug { | ||||||||||||||||||||||||||
|
Subroutine
get_bug: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||||||||||||||||||||
| 30 | 0 | my ($self, $id) = @_; | |||||||||||||||||||||||||||
| 31 | 0 | my $res = $self->client->get($self->_mkuri("bug_user_last_visit/$id")); | |||||||||||||||||||||||||||
| 32 | 0 | ▶ | return unless $res && @{$res}; | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$res and @{$res;}
MC/DC0%0/2
$res and @{$res;}
$res
@{$res;}
Truth table0%0/3
A and B
A= $resB= @{$res;}
| |||||||||||||||||||||||||||||
| 33 | return $self->new( | ||||||||||||||||||||||||||||
| 34 | client => $self->client, | ||||||||||||||||||||||||||||
| 35 | 0 | %{ $res->[0] } | |||||||||||||||||||||||||||
| 36 | ); | ||||||||||||||||||||||||||||
| 37 | } | ||||||||||||||||||||||||||||
| 38 | |||||||||||||||||||||||||||||
| 39 | 0 | ▶ | sub update { | ||||||||||||||||||||||||||
|
Subroutine
update: not called CC=4 SCAR=30.0
Pod
documented
| |||||||||||||||||||||||||||||
| 40 | 0 | my $self = shift; | |||||||||||||||||||||||||||
| 41 | 0 | ▶ | my $id = $self->has_id ? $self->id : shift; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 42 | 0 | my $res = $self->client->post($self->_mkuri("bug_user_last_visit/$id"), {}); | |||||||||||||||||||||||||||
| 43 | 0 | ▶ | return unless $res && @{$res}; | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$res and @{$res;}
MC/DC0%0/2
$res and @{$res;}
$res
@{$res;}
Truth table0%0/3
A and B
A= $resB= @{$res;}
| |||||||||||||||||||||||||||||
| 44 | return $self->new( | ||||||||||||||||||||||||||||
| 45 | client => $self->client, | ||||||||||||||||||||||||||||
| 46 | 0 | %{ $res->[0] } | |||||||||||||||||||||||||||
| 47 | ); | ||||||||||||||||||||||||||||
| 48 | } | ||||||||||||||||||||||||||||
| 49 | |||||||||||||||||||||||||||||
| 50 | 0 | ▶ | sub update_bugs { | ||||||||||||||||||||||||||
|
Subroutine
update_bugs: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||||||||||||||||||
| 51 | 0 | my ($self, @ids) = @_; | |||||||||||||||||||||||||||
| 52 | 0 | my $res = $self->client->post($self->_mkuri('bug_user_last_visit'), \@ids); | |||||||||||||||||||||||||||
| 53 | return [ | ||||||||||||||||||||||||||||
| 54 | map { | ||||||||||||||||||||||||||||
| 55 | $self->new( | ||||||||||||||||||||||||||||
| 56 | client => $self->client, | ||||||||||||||||||||||||||||
| 57 | 0 | %{ $_ } | |||||||||||||||||||||||||||
| 58 | ) | ||||||||||||||||||||||||||||
| 59 | } | ||||||||||||||||||||||||||||
| 60 | 0 | ▶ | @{ $res // [] } | ||||||||||||||||||||||||||
|
Condition0%0/2
$res // []
MC/DC0%0/1
$res // []
$res
Truth table0%0/2
A
A= $res
| |||||||||||||||||||||||||||||
| 61 | ]; | ||||||||||||||||||||||||||||
| 62 | } | ||||||||||||||||||||||||||||
| 63 | |||||||||||||||||||||||||||||
| 64 | 1 | 1; | |||||||||||||||||||||||||||
| 65 | |||||||||||||||||||||||||||||
| 66 | __END__ | ||||||||||||||||||||||||||||