| 1 | package Catalyst::Seal::Dispatch; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 3 | 19 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 4 | 19 | ▶ | use warnings; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 5 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 6 | 19 | ▶ | use Encode (); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 7 | 19 | ▶ | use Scalar::Util (); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 9 | 19 | ▶ | use Catalyst::Seal (); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 10 | 19 | ▶ | use Catalyst::Seal::Guard (); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 12 | 19 | our $VERSION = '0.04'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 13 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 14 | 19 | my %PATH; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 15 | my %ACTIONS; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 17 | 19 | our $MAX_KEYS = 2048; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 18 | 19 | my $CAPPED = 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 19 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 20 | 1 | ▶ | sub capped { $CAPPED } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
capped: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 21 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 22 | 4 | ▶ | sub _clear { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_clear: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 23 | 4 | %PATH = (); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 24 | 4 | %ACTIONS = (); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 25 | 4 | $CAPPED = 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 26 | 4 | return; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 27 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 28 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 29 | 6 | ▶ | sub memo_sizes { return (scalar keys %PATH, scalar keys %ACTIONS) } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
memo_sizes: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 30 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 31 | 210 | ▶ | sub _invoke_as_path { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_invoke_as_path: called CC=12 SCAR=25.9
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 32 | 210 | my ( $self, $c, $rel_path, $args ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 33 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 34 | 210 | my $base = ''; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 35 | 210 | ▶ | if ($rel_path !~ m{\A/}) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 36 | 0 | my $top = $c->stack->[-1]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 37 | 0 | ▶ | $base = $top ? $top->namespace : ''; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 38 | 0 | ▶ | $base = '' unless defined $base; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 39 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 40 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 41 | 210 | my $key = "$base\0$rel_path"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 42 | 210 | my $hit = $PATH{$key}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 43 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 44 | 210 | ▶ | unless ($hit) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 45 | 203 | my (@extra_args, $found); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 46 | 203 | my $path = $self->_action_rel2abs( $c, $rel_path ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 47 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 48 | 203 | my $tail; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 49 | 203 | ▶ | while ( ( $path, $tail ) = ( $path =~ m#^(?:(.*)/)?(\w+)?$# ) ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 50 | 603 | ▶ | if ( my $action = $c->get_action( $tail, $path ) ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 51 | 3 | $found = $action; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 52 | 3 | last; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 53 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 54 | else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 55 | 600 | ▶ | last unless $path; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 56 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 57 | 400 | unshift @extra_args, $tail; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 58 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 59 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 60 | 203 | $hit = [ $found, \@extra_args ]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 61 | 203 | ▶ | if (keys %PATH < $MAX_KEYS) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 62 | 11 | $PATH{$key} = $hit; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 63 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 64 | elsif (!$CAPPED++) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 65 | 1 | Catalyst::Seal::note( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 66 | "dispatch path memo reached $MAX_KEYS keys, no longer caching"); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 67 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 68 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 69 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 70 | 210 | my ($action, $extra) = @$hit; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 71 | 210 | ▶ | return unless $action; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 72 | 10 | ▶ | push @$args, @$extra if @$extra; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 73 | 10 | return $action; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 74 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 75 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 76 | 1149 | ▶ | sub _get_actions { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_get_actions: called CC=6 SCAR=18.1
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 77 | 1149 | my ( $self, $c, $action, $namespace ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 78 | 1149 | ▶ | return [] unless $action; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 79 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 80 | 1149 | ▶ | my $key = "$action\0" . (defined $namespace ? $namespace : ''); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 81 | 1149 | my $hit = $ACTIONS{$key}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 82 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 83 | 1149 | ▶ | unless ($hit) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 84 | 57 | ▶ | my $ns = join( "/", grep { length } split '/', $namespace || "" ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition100%2/2
$namespace || ''
MC/DC100%1/1
$namespace || ''
$namespace
Truth table100%2/2
A
A= $namespace
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 85 | 57 | my @match = $self->get_containers($ns); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 86 | 57 | $hit = [ map { $_->get_action($action) } @match ]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 87 | 57 | ▶ | $ACTIONS{$key} = $hit if keys %ACTIONS < $MAX_KEYS; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 88 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 89 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 90 | 1149 | return @$hit; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 91 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 92 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 93 | 19 | my %PLAN; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 94 | my %DISPATCH; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 95 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 96 | 1 | ▶ | sub _clear_chain { %PLAN = (); %DISPATCH = (); return } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_clear_chain: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 97 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 98 | 1834 | ▶ | sub _run { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_run: called CC=2 SCAR=6.9
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 99 | 1834 | my ($c, $action) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 100 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 101 | 1834 | my @args = @{ $c->request->arguments }; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 102 | 1834 | local $c->request->{arguments} = \@args; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 103 | 19 | ▶ | no warnings 'recursion'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 104 | 1834 | $action->dispatch($c); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 105 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 106 | 1834 | ▶ | $c->state(0) if @{ $c->error }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 107 | 1834 | return $c->state; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 108 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 109 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 110 | 367 | ▶ | sub _dispatch { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_dispatch: called CC=8 SCAR=22.9
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 111 | 367 | my ($self, $c) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 112 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 113 | 367 | my $action = $c->action; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 114 | 367 | my $stock = $Catalyst::Seal::Guard::ORIGINAL{'Catalyst::Dispatcher::dispatch'}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 115 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 116 | 367 | ▶ | return $stock ? $stock->($self, $c) : () unless $action; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 117 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 118 | 367 | my $ns = $action->namespace; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 119 | 367 | ▶ | $ns = '' unless defined $ns; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 120 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 121 | 367 | my $disp = $DISPATCH{$ns}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 122 | 367 | ▶ | unless (defined $disp) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 123 | 16 | ▶ | $disp = $DISPATCH{$ns} = $c->get_action('_DISPATCH', $ns) || 0; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$c->get_action('_DISPATCH', $ns) || 0
MC/DC0%0/1
$c->get_action('_DISPATCH', $ns) || 0
$c->get_action('_DISPATCH', $ns)
Truth table50%1/2
A
A= $c->get_action('_DISPATCH', $ns)
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 124 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 125 | 367 | ▶ | return $stock ? $stock->($self, $c) : () unless $disp; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 126 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 127 | 367 | _run($c, $disp); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 128 | 367 | return; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 129 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 130 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 131 | 0 | ▶ | sub _state_one { $_[0]->state(1); return 1 } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_state_one: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 132 | 0 | ▶ | sub _state_or_one { my $c = shift; $c->state($c->state || 1); return 1 } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_state_or_one: not called CC=2 SCAR=17.9
Condition0%0/2
$c->state || 1
MC/DC0%0/1
$c->state || 1
$c->state
Truth table0%0/2
A
A= $c->state
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 133 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 134 | 16 | ▶ | sub _build_plan { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_build_plan: called CC=8 SCAR=22.8
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 135 | 16 | my ($c, $self, $ns) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 136 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 137 | 16 | my $begin = ( $c->get_actions('begin', $ns) )[-1]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 138 | 16 | my @autos = $c->get_actions('auto', $ns); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 139 | 16 | my $end = ( $c->get_actions('end', $ns) )[-1]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 140 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 141 | 16 | ▶ | my %noop = ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 142 | _BEGIN => ($begin ? undef : \&_state_one), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 143 | _AUTO => (@autos ? undef : \&_state_or_one), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 144 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 145 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 146 | 16 | my @steps; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 147 | 16 | for my $name (@{ $self->_dispatch_steps }) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 148 | 48 | ▶ | if ($noop{$name}) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 149 | 0 | push @steps, $noop{$name}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 150 | 0 | next; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 151 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 152 | 48 | ▶ | my $a = $c->get_action($name, $ns) or return 0; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 153 | 48 | push @steps, $a; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 154 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 155 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 156 | 16 | my $end_step; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 157 | 16 | ▶ | if ($end) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 158 | 16 | ▶ | $end_step = $c->get_action('_END', $ns) or return 0; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 159 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 160 | else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 161 | 0 | $end_step = \&_state_one; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 162 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 163 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 164 | 16 | return { steps => \@steps, end => $end_step }; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 165 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 166 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 167 | 367 | ▶ | sub _controller_dispatch { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_controller_dispatch: called CC=10 SCAR=25.2
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 168 | 367 | my ($self, $c) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 169 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 170 | 367 | my $top = $c->stack->[-1]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 171 | 367 | ▶ | my $ns = $top ? $top->namespace : ''; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 172 | 367 | ▶ | $ns = '' unless defined $ns; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 173 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 174 | 367 | my $plan = $PLAN{$ns}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 175 | 367 | ▶ | $plan = $PLAN{$ns} = _build_plan($c, $self, $ns) unless defined $plan; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 176 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 177 | 367 | ▶ | unless ($plan) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 178 | 0 | my $stock = $Catalyst::Seal::Guard::ORIGINAL{'Catalyst::Controller::_DISPATCH'}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 179 | 0 | ▶ | return $stock ? $stock->($self, $c) : (); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 180 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 181 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 182 | 367 | for my $step (@{ $plan->{steps} }) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 183 | 1100 | ▶ | last unless ref $step eq 'CODE' ? $step->($c) : _run($c, $step); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 184 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 185 | 367 | my $end = $plan->{end}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 186 | 367 | ▶ | ref $end eq 'CODE' ? $end->($c) : _run($c, $end); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 187 | 367 | return; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 188 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 189 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 190 | 19 | my %COMPONENT; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 191 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 192 | 1 | ▶ | sub _clear_components { %COMPONENT = (); return } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_clear_components: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 193 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 194 | 3728 | ▶ | sub _component { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_component: called CC=18 SCAR=37.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 195 | 3728 | my ($c, $name, @args) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 196 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 197 | 3728 | ▶ | if (defined $name && !ref $name && !@args) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%2/6
defined $name and not ref $name and not @args
defined $name and not ref $name
MC/DC0%0/3
defined $name and not ref $name and not @args
defined $name
not ref $name
not @args
Truth table25%1/4
A and not(B) and not(C)
A= defined $nameB= not ref $nameC= not @args
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 198 | 3728 | my $hit = $COMPONENT{$name}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 199 | 3728 | ▶ | return $hit->[0] if $hit; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 200 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 201 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 202 | 217 | my $stock = $Catalyst::Seal::Guard::ORIGINAL{'Catalyst::component'}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 203 | 217 | ▶ | my @out = $stock ? $stock->($c, $name, @args) : (); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 204 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 205 | 217 | ▶ | if (defined $name && !ref $name && !@args && @out == 1) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition44%4/9
defined $name and not ref $name and not @args and @out == 1
defined $name and not ref $name and not @args
defined $name and not ref $name
MC/DC25%1/4
defined $name and not ref $name and not @args and @out == 1
defined $name
not ref $name
not @args
@out == 1
Truth table40%2/5
A and not(B) and not(C) and D
A= defined $nameB= not ref $nameC= not @argsD= @out == 1
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 206 | 17 | ▶ | my $comps = eval { $c->components } || {}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
eval {
do {
$c->components
}
} || {}
MC/DC0%0/1
eval {
do {
$c->components
}
} || {}
eval {
do {
$c->components
}
}
Truth table50%1/2
A
A= eval {
do {
$c->components
}
}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 207 | 17 | my $raw = $comps->{$name}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 208 | 17 | ▶ | if (defined $raw && Scalar::Util::blessed($raw) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%4/12
defined $raw and builtin::blessed($raw) and not $raw->can("ACCEPT_CONTEXT") and builtin::blessed($out[0]) and builtin::refaddr($out[0]) == builtin::refaddr($raw)
defined $raw and builtin::blessed($raw) and not $raw->can("ACCEPT_CONTEXT") and builtin::blessed($out[0])
defined $raw and builtin::blessed($raw) and not $raw->can("ACCEPT_CONTEXT")
defined $raw and builtin::blessed($raw)
MC/DC0%0/5
defined $raw and builtin::blessed($raw) and not $raw->can("ACCEPT_CONTEXT") and builtin::blessed($out[0]) and builtin::refaddr($out[0]) == builtin::refaddr($raw)
defined $raw
builtin::blessed($raw)
not $raw->can("ACCEPT_CONTEXT")
builtin::blessed($out[0])
builtin::refaddr($out[0]) == builtin::refaddr($raw)
Truth table16%1/6
A and B and not(C) and D and E
A= defined $rawB= builtin::blessed($raw)C= not $raw->can("ACCEPT_CONTEXT")D= builtin::blessed($out[0])E= builtin::refaddr($out[0]) == builtin::refaddr($raw)
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 209 | && !$raw->can('ACCEPT_CONTEXT') | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 210 | && Scalar::Util::blessed($out[0]) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 211 | && Scalar::Util::refaddr($out[0]) == Scalar::Util::refaddr($raw)) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 212 | 17 | ▶ | $COMPONENT{$name} = [ $out[0] ] if keys %COMPONENT < $MAX_KEYS; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 213 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 214 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 215 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 216 | 217 | ▶ | return wantarray ? @out : $out[0]; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 217 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 218 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 219 | 12 | ▶ | sub _rewire_dispatch_actions { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_rewire_dispatch_actions: called CC=9 SCAR=22.8
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 220 | 12 | my ($app) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 221 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 222 | 12 | ▶ | my $stock = $Catalyst::Seal::Guard::ORIGINAL{'Catalyst::Controller::_DISPATCH'} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 223 | or return 0; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 224 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 225 | 12 | ▶ | my $hash = eval { $app->dispatcher->_action_hash } or return 0; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 226 | 12 | my $done = 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 227 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 228 | 12 | for my $action (values %$hash) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 229 | 576 | ▶ | next unless $action && $action->name eq '_DISPATCH'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
$action and $action->name eq "_DISPATCH"
MC/DC50%1/2
$action and $action->name eq "_DISPATCH"
$action
$action->name eq "_DISPATCH"
Truth table66%2/3
A and B
A= $actionB= $action->name eq "_DISPATCH"
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 230 | 36 | ▶ | my $code = $action->{code} or next; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 231 | 36 | ▶ | next unless Scalar::Util::refaddr($code) == Scalar::Util::refaddr($stock); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 232 | 36 | $action->{code} = \&_controller_dispatch; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 233 | 36 | $done++; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 234 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 235 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 236 | 12 | ▶ | Catalyst::Seal::note("rewired $done _DISPATCH action(s)") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 237 | if $Catalyst::Seal::DEBUG; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 238 | 12 | return $done; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 239 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 240 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 241 | 19 | my $PATCHED = 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 242 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 243 | 12 | ▶ | Catalyst::Seal::register_step('dispatch' => sub { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=6 SCAR=19.6
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 244 | 12 | my ($app) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 245 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 246 | 12 | ▶ | return if $PATCHED++; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 247 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 248 | 12 | my $path = Catalyst::Seal::Guard::replace( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 249 | 'Catalyst::Dispatcher::_invoke_as_path' => \&_invoke_as_path); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 250 | 12 | my $actions = Catalyst::Seal::Guard::replace( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 251 | 'Catalyst::Dispatcher::get_actions' => \&_get_actions); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 252 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 253 | 12 | ▶ | unless ($path || $actions) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
$path or $actions
MC/DC0%0/2
$path or $actions
$path
$actions
Truth table33%1/3
A or B
A= $pathB= $actions
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 254 | 0 | Catalyst::Seal::note('neither dispatch lookup was memoised'); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 255 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 256 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 257 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 258 | Catalyst::Seal::Guard::replace( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 259 | 12 | 'Catalyst::Dispatcher::dispatch' => \&_dispatch); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 260 | 12 | Catalyst::Seal::Guard::replace( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 261 | 'Catalyst::Controller::_DISPATCH' => \&_controller_dispatch); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 262 | 12 | _rewire_dispatch_actions($app); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 263 | 12 | Catalyst::Seal::Guard::replace( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 264 | 'Catalyst::component' => \&_component); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 265 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 266 | 12 | my $register = Catalyst::Dispatcher->can('register'); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 267 | 12 | ▶ | if ($register) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 268 | 19 | ▶ | no warnings 'redefine'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 269 | 1 | ▶ | *Catalyst::Dispatcher::register = sub { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 270 | 1 | _clear(); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 271 | 1 | _clear_chain(); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 272 | 1 | _clear_components(); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 273 | 1 | return $register->(@_); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 274 | 12 | }; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 275 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 276 | else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 277 | 0 | Catalyst::Seal::note( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 278 | 'no Catalyst::Dispatcher::register to hook, memos cannot be invalidated'); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 279 | 0 | Catalyst::Seal::Guard::restore('Catalyst::Dispatcher::_invoke_as_path'); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 280 | 0 | Catalyst::Seal::Guard::restore('Catalyst::Dispatcher::get_actions'); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 281 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 282 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 283 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 284 | 12 | ▶ | Catalyst::Seal::note("memoised dispatch lookups (path=$path actions=$actions)") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 285 | if $Catalyst::Seal::DEBUG; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 286 | 12 | return; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 287 | 19 | }); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 288 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 289 | 19 | 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 290 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 291 | __END__ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||