Pithub/Repos/Stats.pm

filter: Statementstmt 82.3% 14 / 17 Branchbran 25.0% 1 / 4 Conditioncond 50.0% 1 / 2 MC/DCmcdc 0.0% 0 / 1 Subroutinesub 100% 2 / 2 Podpod 100% 1 / 1 totaltotal 70.3% 19 / 27 CC 4 SCAR 15.0
CC
4
Cov
70%
contributors
5.3
BEGIN
1.0
CRAP 4.5
« Pithub/Base.pm ↑ Summary Pithub/Markdown.pm »
1 package Pithub::Repos::Stats;
2 16 our $AUTHORITY = 'cpan:PLU';
3 16 our $VERSION = '0.01041';
4  
5 # ABSTRACT: Github v3 repos / stats API
6  
7 16 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 16 extends 'Pithub::Base';
10  
11  
12 sub contributors {
13 2 ▶ my ( $self, %args ) = @_;
Subroutine contributors: called CC=4 SCAR=16.8
Pod documented
14  
15 # The default is to not wait for 200
16 2 ▶ my $sleep = delete $args{wait_for_200} || 0;
Condition50%1/2
delete $args{'wait_for_200'} || 0
l!l
02
MC/DC0%0/1
delete $args{'wait_for_200'} || 0
delete $args{'wait_for_200'}
Truth table50%1/2
A
A= delete $args{'wait_for_200'}
Aresult
11
00
17 2 $self->_validate_user_repo_args( \%args );
18 my $req = {
19 method => 'GET',
20 path => sprintf(
21 '/repos/%s/%s/stats/contributors',
22 delete $args{user}, delete $args{repo}
23 2 ),
24 %args
25 };
26 2 my $res = $self->request(%$req);
27  
28 2 ▶ if ($sleep) {
Branch: 1 branch
BranchTrueFalseTotal
if ($sleep) 0 2 2
29 0 ▶ while ( $res->response->code == 202 ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($res->response->code == 202) 0 0 0
30 0 sleep $sleep;
31 0 $res = $self->request(%$req);
32 }
33 }
34 2 return $res;
35 }
36  
37 16 1;
38  
39 __END__
« Pithub/Base.pm ↑ Summary Pithub/Markdown.pm »