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.103';
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 sub compare ($self, $request_path)
9 ▶{
Subroutine compare: called CC=4 SCAR=13.9
Pod documented
10 237 my $pattern = $self->pattern;
11  
12 237 ▶ if ($self->is_bridge) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->is_bridge) { } 206 31 237
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 31 ▶ unless $request_path eq $pattern;
Branch: 1 branch
BranchTrueFalseTotal
unless $request_path eq $pattern 19 12 31
19 }
20  
21 # this pattern does not really match anything other than the pattern itself
22 # - return empty (but defined) list of matches
23 211 return [];
24 }
25  
26 sub build ($self, @more_args)
27 ▶{
Subroutine build: called CC=1 SCAR=0.0
Pod documented
28 1 return $self->pattern;
29 }
30  
31 __END__
« Gears/Generator.pm ↑ Summary Gears/Config/Reader.pm »