blib/lib/Magpie/Breadboard.pm

filter: Statementstmt 90.2% 37 / 41 Branchbran 60.0% 6 / 10 Conditioncond 22.2% 2 / 9 MC/DCmcdc 20.0% 1 / 5 Subroutinesub 92.8% 13 / 14 Podpod 0.0% 0 / 6 totaltotal 69.4% 59 / 85 CC 9 SCAR 18.9
CC
9
Cov
75%
add_asset
16.0
__ANON__
2.0
assets
2.0
CRAP 6.6
« blib/lib/Magpie/Event/Symbol.pm ↑ Summary blib/lib/Magpie/Component.pm »
1 package Magpie::Breadboard;
2 49 $Magpie::Breadboard::VERSION = '1.163200';
3 49 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 # ABSTRACT: Bread::Board Container For Pipeline Assets
6  
7 49 ▶use Bread::Board;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 49 ▶use Bread::Board::Dumper;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 49 extends 'Bread::Board::Container';
11  
12 49 has '+name' => ( default => 'Application' );
13  
14 305 ▶sub BUILD {
Subroutine BUILD: called CC=1 SCAR=0.1
Pod undocumented
15 305 my $self = shift;
16 305 ▶ container $self => as {
Subroutine __ANON__: called CC=1 SCAR=0.2
17 305 ▶ container 'Assets' => as {};
Subroutine __ANON__: called CC=1 SCAR=0.0
18 305 ▶ container 'MagpieInternal' => as {
Subroutine __ANON__: called CC=1 SCAR=0.4
19 service 'default_resource' => (
20 lifecycle => 'Singleton',
21 0 ▶ block => sub {
Subroutine __ANON__: not called CC=1 SCAR=6.9
22 0 my $s = shift;
23 0 Magpie::Resource::Abstract->new;
24 }
25 305 );
26 service 'symbol_table' => (
27 lifecycle => 'Singleton',
28 305 ▶ block => sub {
Subroutine __ANON__: called CC=1 SCAR=0.0
29 305 my $s = shift;
30 305 Magpie::SymbolTable->new;
31 }
32 305 );
33  
34 305 };
35 305 };
36 }
37  
38 496 ▶sub internal_assets {
Subroutine internal_assets: called CC=1 SCAR=0.0
Pod undocumented
39 496 return shift->get_sub_container('MagpieInternal');
40 }
41  
42 14 ▶sub assets {
Subroutine assets: called CC=2 SCAR=6.9
Pod undocumented
43 14 my $self = shift;
44 14 ▶ if ( my $new_container = shift ) {
Branch: 1 branch
BranchTrueFalseTotal
if (my $new_container = shift()) 3 11 14
45 3 delete $self->sub_containers->{'Assets'};
46 3 $new_container->name('Assets');
47 3 $self->add_sub_container( $new_container );
48 }
49 14 return $self->get_sub_container('Assets');
50 }
51  
52 12 ▶sub add_asset {
Subroutine add_asset: called CC=8 SCAR=27.7
Pod undocumented
53 12 my $self = shift;
54 12 my $thing = shift;
55  
56 12 my $assets = $self->get_sub_container('Assets');
57  
58 12 ▶ if ( blessed $thing ) {
Branch: 2 branches
BranchTrueFalseTotal
if (builtin::blessed($thing)) { } 12 0 12
elsif ($_[0] and builtin::blessed($_[0]) and $_[0]->isa('Bread::Board::Typemap')) { } 0 0 0
59 12 ▶ if ( $thing->isa('Bread::Board::Container') || $thing->isa('Bread::Board::Container::Parmeterized')) {
Branch: 2 branches
BranchTrueFalseTotal
if ($thing->isa('Bread::Board::Container') or $thing->isa('Bread::Board::Container::Parmeterized')) { } 5 7 12
elsif ($thing->does('Bread::Board::Service')) { } 7 0 7
Condition66%2/3
$thing->isa("Bread::Board::Container") or $thing->isa("Bread::Board::Container::Parmeterized")
l!l&&r!l&&!r
507
MC/DC50%1/2
$thing->isa("Bread::Board::Container") or $thing->isa("Bread::Board::Container::Parmeterized")
$thing->isa("Bread::Board::Container") $thing->isa("Bread::Board::Container::Parmeterized")
Truth table66%2/3
A or B
A= $thing->isa("Bread::Board::Container")B= $thing->isa("Bread::Board::Container::Parmeterized")
ABresult
1X1
011
000
60 5 $assets->add_sub_container( $thing );
61 }
62 elsif ( $thing->does('Bread::Board::Service') ) {
63 7 $assets->add_service( $thing );
64 }
65 else {
66 0 confess "add_asset requires a type => typemap pair, service, or container."
67 }
68 }
69 ▶ elsif ($_[0] and blessed($_[0]) and $_[0]->isa('Bread::Board::Typemap')){
Condition0%0/6
$_[0] and builtin::blessed($_[0]) and $_[0]->isa("Bread::Board::Typemap")
!ll&&!rl&&r
000
$_[0] and builtin::blessed($_[0])
!ll&&!rl&&r
000
MC/DC0%0/3
$_[0] and builtin::blessed($_[0]) and $_[0]->isa("Bread::Board::Typemap")
$_[0] builtin::blessed($_[0]) $_[0]->isa("Bread::Board::Typemap")
Truth table0%0/4
A and B and C
A= $_[0]B= builtin::blessed($_[0])C= $_[0]->isa("Bread::Board::Typemap")
ABCresult
0XX0
10X0
1100
1111
70 0 $assets->add_type_mapping( $thing => $_[0] );
71 }
72 else {
73  
74 }
75 }
76  
77 496 ▶sub resolve_internal_asset {
Subroutine resolve_internal_asset: called CC=1 SCAR=0.0
Pod undocumented
78 496 return shift->internal_assets->resolve( @_ );
79 }
80  
81 11 ▶sub resolve_asset {
Subroutine resolve_asset: called CC=1 SCAR=0.0
Pod undocumented
82 11 return shift->assets->resolve( @_ );
83 }
84  
85 # SEEALSO: Magpie, Bread::Board
86  
87 49 1;
88  
89 __END__
« blib/lib/Magpie/Event/Symbol.pm ↑ Summary blib/lib/Magpie/Component.pm »