Gitea/API/Misc.pm

filter: Statementstmt 65.0% 13 / 20 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 50.0% 3 / 6 Podpod 100% 2 / 2 totaltotal 64.2% 18 / 28 CC 1 SCAR 4.1
CC
1
Cov
65%
_build_openapi_operations
2.0
version
2.0
current_user
2.0
CRAP 1.5
« Gitea/Repo.pm ↑ Summary Gitea.pm »
1 package WWW::Gitea::API::Misc;
2  
3 # ABSTRACT: Instance-level Gitea endpoints (version, current user)
4  
5 3 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 3 ▶use WWW::Gitea::User;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 3 ▶use namespace::clean;
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9  
10 3 has client => (
11 is => 'ro',
12 required => 1,
13 weak_ref => 1,
14 );
15  
16  
17 has openapi_operations => (
18 is => 'lazy',
19 builder => sub {
20 return {
21 0 ▶ 'misc.version' => { method => 'GET', path => '/version' },
Subroutine _build_openapi_operations: not called CC=1 SCAR=6.9
22 'user.current' => { method => 'GET', path => '/user' },
23 };
24 },
25 3 );
26  
27  
28 3 with 'WWW::Gitea::Role::OpenAPI';
29  
30 sub version {
31 0 ▶ my ($self) = @_;
Subroutine version: not called CC=1 SCAR=6.9
Pod documented
32 0 my $data = $self->call_operation('misc.version');
33 0 return $data->{version};
34 }
35  
36  
37 sub current_user {
38 0 ▶ my ($self) = @_;
Subroutine current_user: not called CC=1 SCAR=6.9
Pod documented
39 0 my $data = $self->call_operation('user.current');
40 0 return WWW::Gitea::User->new(client => $self->client, data => $data);
41 }
42  
43  
44  
45 3 1;
46  
47 __END__
« Gitea/Repo.pm ↑ Summary Gitea.pm »