Model/Adaptor/Base.pm

filter: Statementstmt 51.6% 16 / 31 Branchbran 0.0% 0 / 4 Conditioncond 0.0% 0 / 2 MC/DCmcdc 0.0% 0 / 1 Subroutinesub 55.5% 5 / 9 Podpod 100% 2 / 2 totaltotal 46.9% 23 / 49 CC 4 SCAR 12.8
CC
4
Cov
43%
_load_adapted_class
6.0
_create_instance
6.0
prepare_arguments
6.0
CRAP 3.6
« Helper/Model/Adaptor.pm ↑ Summary Model/Factory/PerRequest.pm »
1 package Catalyst::Model::Adaptor::Base;
2 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 1 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 1 ▶use MRO::Compat;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 1 ▶use base 'Catalyst::Model';
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 0 ▶sub _load_adapted_class {
Subroutine _load_adapted_class: not called CC=2 SCAR=17.9
11 0 my ($self) = @_;
12  
13 0 ▶ croak 'need class' unless $self->{class};
Branch: 1 branch
BranchTrueFalseTotal
unless $self->{"class"} 0 0 0
14 0 my $adapted_class = $self->{class};
15 0 Catalyst::Utils::ensure_class_loaded($adapted_class);
16  
17 0 return $adapted_class;
18 }
19  
20 0 ▶sub _create_instance {
Subroutine _create_instance: not called CC=2 SCAR=17.9
21 0 my ($self, $app, $rest) = @_;
22  
23 0 ▶ my $constructor = $self->{constructor} || 'new';
Condition0%0/2
$self->{'constructor'} || 'new'
l!l
00
MC/DC0%0/1
$self->{'constructor'} || 'new'
$self->{'constructor'}
Truth table0%0/2
A
A= $self->{'constructor'}
Aresult
11
00
24 0 my $arg = $self->prepare_arguments($app, $rest);
25 0 my $adapted_class = $self->{class};
26  
27 0 return $adapted_class->$constructor($self->mangle_arguments($arg));
28 }
29  
30 0 ▶sub prepare_arguments {
Subroutine prepare_arguments: not called CC=2 SCAR=17.9
Pod documented
31 0 my ($self, $app, $arg) = @_;
32 return exists $self->{args} ? {
33 0 ▶ %{$self->{args}},
Branch: 1 branch
BranchTrueFalseTotal
exists $self->{'args'} ? : 0 0 0
34 %$arg,
35 } : $arg;
36 }
37  
38 0 ▶sub mangle_arguments {
Subroutine mangle_arguments: not called CC=1 SCAR=6.9
Pod documented
39 0 my ($self, $args) = @_;
40 0 return $args;
41 }
42  
43 1 1;
44  
45 __END__
« Helper/Model/Adaptor.pm ↑ Summary Model/Factory/PerRequest.pm »