Model/Factory.pm

filter: Statementstmt 62.5% 20 / 32 Branchbran 0.0% 0 / 4 Conditioncond 0.0% 0 / 2 MC/DCmcdc 0.0% 0 / 1 Subroutinesub 75.0% 6 / 8 Podpod 100% 2 / 2 totaltotal 57.1% 28 / 49 CC 4 SCAR 20.8
CC
4
Cov
53%
ACCEPT_CONTEXT
20.0
COMPONENT
2.0
BEGIN
1.0
CRAP 8.0
« Model/Adaptor.pm ↑ Summary Helper/Model/Adaptor.pm »
1 package Catalyst::Model::Factory;
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 1 ▶use MRO::Compat;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 1 ▶use base 'Catalyst::Model::Adaptor::Base';
Subroutine BEGIN: called CC=1 SCAR=0.0
7 1 ▶use Catalyst::Utils ();
Subroutine BEGIN: called CC=1 SCAR=0.0
8 1 ▶use Scalar::Util 'blessed';
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 1 our $VERSION = '0.10';
11  
12 0 ▶sub COMPONENT {
Subroutine COMPONENT: not called CC=1 SCAR=6.9
Pod documented
13 0 my ($class, @args) = @_;
14 0 my $self = $class->next::method(@args);
15  
16 0 $self->_load_adapted_class;
17 0 return $self;
18 }
19  
20 0 ▶sub ACCEPT_CONTEXT {
Subroutine ACCEPT_CONTEXT: not called CC=4 SCAR=30.0
Pod documented
21 0 my ($self, $context, @args) = @_;
22 0 my $arg = {};
23 0 ▶ if ( scalar @args ) {
Branch: 1 branch
BranchTrueFalseTotal
if (scalar @args) 0 0 0
24 0 ▶ if ( ref($args[0]) eq 'HASH' ) {
Branch: 1 branch
BranchTrueFalseTotal
if (ref $args[0] eq 'HASH') { } 0 0 0
25 0 $arg = $args[0];
26 }
27 else {
28 0 $arg = { @args };
29 }
30 }
31 0 my $suffix = Catalyst::Utils::class2classsuffix(blessed $self);
32 return $self->_create_instance(
33 $context,
34 0 ▶ $self->merge_config_hashes($context->config->{$suffix} || {}, $arg),
Condition0%0/2
$context->config->{$suffix} || {}
l!l
00
MC/DC0%0/1
$context->config->{$suffix} || {}
$context->config->{$suffix}
Truth table0%0/2
A
A= $context->config->{$suffix}
Aresult
11
00
35 );
36 }
37  
38 1 1;
39 __END__
« Model/Adaptor.pm ↑ Summary Helper/Model/Adaptor.pm »