Gears/Router/Pattern/Match.pm

filter: Statementstmt 100% 14 / 14 Branchbran 100% 6 / 6 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 4 / 4 Podpod 100% 2 / 2 totaltotal 100% 26 / 26 CC 4 SCAR 10.0
CC
4
Cov
100%
compare
4.0
BEGIN
1.0
BEGIN
1.0
CRAP 2.7
« Gears/Generator.pm ↑ Summary Gears/Config/Reader.pm »
1 package Gears::Router::Pattern::Match;
2 1 $Gears::Router::Pattern::Match::VERSION = '0.105';
3 1 ▶use v5.40;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use Mooish::Base -standard;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 1 extends 'Gears::Router::Pattern';
7  
8 242 ▶sub compare ($self, $request_path)
Subroutine compare: called CC=4 SCAR=13.9
Pod documented
9 {
10 242 my $pattern = $self->pattern;
11 242 my $separator = $self->location->router->pattern_separator;
12  
13 242 ▶ if ($self->is_bridge) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->is_bridge) { } 208 34 242
14 return undef
15 208 ▶ unless scalar $request_path =~ m/^\Q$pattern\E(\Q$separator\E|$)/;
Branch: 1 branch
BranchTrueFalseTotal
unless scalar $request_path =~ /^\Q$pattern\E(\Q$separator\E|$)/u 9 199 208
16 }
17 else {
18 return undef
19 34 ▶ unless $request_path eq $pattern;
Branch: 1 branch
BranchTrueFalseTotal
unless $request_path eq $pattern 21 13 34
20 }
21  
22 # this pattern does not really match anything other than the pattern itself
23 # - return empty (but defined) list of matches
24 212 return [];
25 }
26  
27 1 ▶sub build ($self, @more_args)
Subroutine build: called CC=1 SCAR=0.0
Pod documented
28 {
29 1 return $self->pattern;
30 }
31  
32 __END__
« Gears/Generator.pm ↑ Summary Gears/Config/Reader.pm »