Gears/Router/Pattern/Match.pm

filter: Statementstmt 100% 13 / 13 Branchbran 100% 6 / 6 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 4 / 4 Podpod 100% 2 / 2 totaltotal 100% 25 / 25 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.104';
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 239 ▶sub compare ($self, $request_path)
Subroutine compare: called CC=4 SCAR=13.9
Pod documented
9 {
10 239 my $pattern = $self->pattern;
11  
12 239 ▶ if ($self->is_bridge) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->is_bridge) { } 206 33 239
13 return undef
14 206 ▶ unless scalar $request_path =~ m/^\Q$pattern\E/;
Branch: 1 branch
BranchTrueFalseTotal
unless scalar $request_path =~ /^\Q$pattern\E/u 7 199 206
15 }
16 else {
17 return undef
18 33 ▶ unless $request_path eq $pattern;
Branch: 1 branch
BranchTrueFalseTotal
unless $request_path eq $pattern 20 13 33
19 }
20  
21 # this pattern does not really match anything other than the pattern itself
22 # - return empty (but defined) list of matches
23 212 return [];
24 }
25  
26 1 ▶sub build ($self, @more_args)
Subroutine build: called CC=1 SCAR=0.0
Pod documented
27 {
28 1 return $self->pattern;
29 }
30  
31 __END__
« Gears/Generator.pm ↑ Summary Gears/Config/Reader.pm »