| 1 | 1 | ▶ | use 5.010; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 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 | package CatalystX::TraitFor::Dispatcher::ExactMatch; | ||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||
| 7 | 1 | ▶ | use Moose::Role; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||
| 9 | BEGIN | ||||||||||||||||||||||||||||
| 10 | 1 | ▶ | { | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 11 | 1 | $CatalystX::TraitFor::Dispatcher::ExactMatch::AUTHORITY = 'cpan:TOBYINK'; | |||||||||||||||||||||||||||
| 12 | 1 | $CatalystX::TraitFor::Dispatcher::ExactMatch::VERSION = '0.003'; | |||||||||||||||||||||||||||
| 13 | } | ||||||||||||||||||||||||||||
| 14 | |||||||||||||||||||||||||||||
| 15 | 1 | requires qw( dispatch_types ); | |||||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||||||
| 17 | around prepare_action => sub | ||||||||||||||||||||||||||||
| 18 | 0 | ▶ | { | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=7 SCAR=40.3
| |||||||||||||||||||||||||||||
| 19 | 0 | my $next = shift; | |||||||||||||||||||||||||||
| 20 | 0 | my $self = shift; | |||||||||||||||||||||||||||
| 21 | 0 | my ($ctx, @etc) = @_; | |||||||||||||||||||||||||||
| 22 | |||||||||||||||||||||||||||||
| 23 | 0 | my $req = $ctx->req; | |||||||||||||||||||||||||||
| 24 | 0 | (my $path = $req->path) =~ s{^/+}{}; | |||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||
| 26 | 0 | my $matched = 0; | |||||||||||||||||||||||||||
| 27 | 0 | foreach my $type ( @{ $self->dispatch_types } ) | |||||||||||||||||||||||||||
| 28 | { | ||||||||||||||||||||||||||||
| 29 | 0 | ▶ | if (!$matched and $type->match($ctx, $path)) | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
not $matched and $type->match($ctx, $path)
MC/DC0%0/2
not $matched and $type->match($ctx, $path)
not $matched
$type->match($ctx, $path)
Truth table0%0/3
not(A) and B
A= not $matchedB= $type->match($ctx, $path)
| |||||||||||||||||||||||||||||
| 30 | { | ||||||||||||||||||||||||||||
| 31 | 0 | $matched++; | |||||||||||||||||||||||||||
| 32 | } | ||||||||||||||||||||||||||||
| 33 | } | ||||||||||||||||||||||||||||
| 34 | |||||||||||||||||||||||||||||
| 35 | 0 | ▶ | if ($matched) | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 36 | { | ||||||||||||||||||||||||||||
| 37 | 0 | $ctx->log->debug(sprintf('Got exact match "%s"', $req->match)); | |||||||||||||||||||||||||||
| 38 | 0 | ▶ | s/%([0-9A-Fa-f]{2})/chr(hex($1))/eg foreach grep { defined } @{$req->captures||[]}; | ||||||||||||||||||||||||||
|
Condition0%0/2
$req->captures || []
MC/DC0%0/1
$req->captures || []
$req->captures
Truth table0%0/2
A
A= $req->captures
| |||||||||||||||||||||||||||||
| 39 | } | ||||||||||||||||||||||||||||
| 40 | |||||||||||||||||||||||||||||
| 41 | 0 | $self->$next($ctx, @etc); | |||||||||||||||||||||||||||
| 42 | 1 | }; | |||||||||||||||||||||||||||
| 43 | |||||||||||||||||||||||||||||
| 44 | 1 | 'fixed'; | |||||||||||||||||||||||||||
| 45 | |||||||||||||||||||||||||||||
| 46 | __END__ | ||||||||||||||||||||||||||||