| 1 | package Mason::Plugin::RouterSimple::Component; | ||||||||||||
| 2 | 1 | ▶ | BEGIN { | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 3 | 1 | $Mason::Plugin::RouterSimple::Component::VERSION = '0.07'; | |||||||||||
| 4 | } | ||||||||||||
| 5 | 1 | ▶ | use Mason::PluginRole; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 6 | 1 | ▶ | use Router::Simple; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 7 | |||||||||||||
| 8 | 1 | my %router_objects; | |||||||||||
| 9 | |||||||||||||
| 10 | 1 | has 'router_result' => ( is => 'ro' ); | |||||||||||
| 11 | |||||||||||||
| 12 | 1 | ▶ | method allow_path_info ($class:) { | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
Subroutine
allow_path_info: called CC=2 SCAR=6.9
| |||||||||||||
| 13 | 11 | ▶ | return $class->router_object ? 1 : 0; | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 14 | 1 | } | |||||||||||
| 15 | |||||||||||||
| 16 | 1 | ▶ | method router_add ($class: $pattern, $dest) { | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
Subroutine
router_add: called CC=3 SCAR=11.0
| |||||||||||||
| 17 | 4 | ▶ | $dest ||= {}; | ||||||||||
|
Condition100%2/2
$dest ||= {}
MC/DC100%1/1
$dest ||= {}
$dest
Truth table100%2/2
A
A= $dest
| |||||||||||||
| 18 | 4 | ▶ | unless ( $class->router_object ) { | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 19 | 1 | $class->router_object( $class->router_create_object() ); | |||||||||||
| 20 | } | ||||||||||||
| 21 | 4 | $class->router_object->connect( $pattern, $dest ); | |||||||||||
| 22 | 1 | } | |||||||||||
| 23 | |||||||||||||
| 24 | 1 | ▶ | method router_create_object ($class:) { | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
Subroutine
router_create_object: called CC=1 SCAR=0.0
| |||||||||||||
| 25 | 1 | return Router::Simple->new(); | |||||||||||
| 26 | 1 | } | |||||||||||
| 27 | |||||||||||||
| 28 | 1 | ▶ | method router_object ($class: $object) { | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
Subroutine
__ANON__: called CC=2 SCAR=6.9
| |||||||||||||
| 29 | 46 | ▶ | $router_objects{$class} = $object if ( defined($object) ); | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 30 | 46 | return $router_objects{$class}; | |||||||||||
| 31 | 1 | } | |||||||||||
| 32 | |||||||||||||
| 33 | 1 | 1; | |||||||||||