Articulate/Role/Service.pm

filter: Statementstmt 67.5% 25 / 37 Branchbran 16.6% 1 / 6 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 85.7% 6 / 7 Podpod 0.0% 0 / 1 totaltotal 62.7% 32 / 51 SCAR 16.1
CC
4
Cov
60%
process_request
6.0
__ANON__
4.9
BEGIN
1.0
CRAP 5.0
« Articulate/Sortation/MetaDelver.pm ↑ Summary Articulate/Credentials.pm »
1 package Articulate::Role::Service;
2 9 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 9 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 9 ▶use Moo::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 9 with 'Articulate::Role::Component';
6  
7 9 ▶use Class::Inspector;
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 has verbs => (
10 is => 'rw',
11 default => sub {
12 20 ▶ my $self = shift;
Subroutine __ANON__: called CC=1 SCAR=0.0
13 return {
14 41 map { m/^(handle_(.*))$/; $2 => $1; }
15 1007 grep { /^handle_/ }
16 20 @{ Class::Inspector->methods(ref $self) },
17 };
18 },
19 coerce => sub {
20 20 ▶ my $original = shift;
Subroutine __ANON__: called CC=3 SCAR=16.0
21 20 ▶ if ( ref $original eq ref {} ) {
Branch: 2 branches
BranchTrueFalseTotal
if (ref $original eq ref {}) { } 20 0 20
elsif (ref $original eq ref {}) { } 0 0 0
22 20 return $original;
23 }
24 elsif ( ref $original eq ref {} ) {
25 0 return { map { $_ => "handle_$_"; } @$original };
26 }
27 0 return { $original => "handle_$original" }
28 },
29 9 );
30  
31 sub process_request {
32 0 ▶ my $self = shift;
Subroutine process_request: not called CC=2 SCAR=17.9
Pod undocumented
33 0 my $request = shift;
34 0 my $verbs = $self->verbs;
35 0 my $verb = $request->verb;
36 0 ▶ if ( exists $verbs->{ $verb } ) {
Branch: 1 branch
BranchTrueFalseTotal
if (exists $verbs->{$verb}) 0 0 0
37 0 my $method = $verbs->{ $verb };
38 0 $request->app($self->app);
39 0 return $self->$method($request, @_);
40 }
41 0 return undef; # whatever else the user wants, we can't provide it
42 }
43  
44 9 with 'Articulate::Role::Component';
45  
46 9 1;
« Articulate/Sortation/MetaDelver.pm ↑ Summary Articulate/Credentials.pm »