API/Request.pm

filter: Statementstmt 81.4% 22 / 27 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 75.0% 6 / 8 Podpod n/a totaltotal 71.7% 28 / 39 CC 3 SCAR 11.0
CC
3
Cov
71%
AUTOLOAD
6.0
__ANON__
6.0
BEGIN
1.0
CRAP 3.0
« API/Action.pm ↑ Summary API.pm »
1 #
2 # This file is part of Redmine-API
3 #
4 # This software is copyright (c) 2014 by celogeek <me@celogeek.com>.
5 #
6 # This is free software; you can redistribute it and/or modify it under
7 # the same terms as the Perl 5 programming language system itself.
8 #
9 package Redmine::API::Request;
10  
11 # ABSTRACT: handle request to the Redmine API
12 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
13 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
14 2 our $VERSION = '0.04'; # VERSION
15 2 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
16  
17 2 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
18 2 ▶use Redmine::API::Action;
Subroutine BEGIN: called CC=1 SCAR=0.0
19  
20 2 ▶use vars qw/$AUTOLOAD/;
Subroutine BEGIN: called CC=1 SCAR=0.0
21  
22 0 ▶sub AUTOLOAD {
Subroutine AUTOLOAD: not called CC=2 SCAR=17.9
23 0 my $self = shift;
24 0 my $route = substr( $AUTOLOAD, length(__PACKAGE__) + 2 );
25 0 ▶ return if $route eq 'DESTROY';
Branch: 1 branch
BranchTrueFalseTotal
if $route eq "DESTROY" 0 0 0
26 0 return Redmine::API::Action->new( request => $self, action => $route );
27 }
28  
29 has 'api' => (
30 is => 'ro',
31 required => 1,
32 0 ▶ isa => sub {
Subroutine __ANON__: not called CC=2 SCAR=17.9
33 0 ▶ croak "api should be a Redmine::API object"
Branch: 1 branch
BranchTrueFalseTotal
if ref $_[0] ne "Redmine::API" 0 0 0
34 if ref $_[0] ne 'Redmine::API';
35 }
36 2 );
37  
38 2 has 'route' => (
39 is => 'ro',
40 required => 1,
41 );
42  
43 2 1;
44  
45 __END__
« API/Action.pm ↑ Summary API.pm »