lib/Lingy/Regex.pm

filter: Statementstmt 100% 26 / 26 Branchbran 100% 6 / 6 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 8 / 8 Podpod 0.0% 0 / 4 totaltotal 90.9% 40 / 44 CC 4 SCAR 7.4
CC
4
Cov
100%
find
4.0
BEGIN
1.0
BEGIN
1.0
CRAP 2.1
« lib/Lingy/Class.pm ↑ Summary blib/lib/Lingy/Namespace.pm »
1 53 ▶use strict; use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
Subroutine BEGIN: called CC=1 SCAR=0.0
2 package Lingy::Regex;
3  
4 53 ▶use Lingy::Common;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 # need these things:
7 # * if-some
8 # * "sequence destructuring bindings"
9  
10 15 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
Pod undocumented
11 15 my ($class, $scalar) = @_;
12 15 bless qr/$scalar/, $class;
13 }
14  
15 7 ▶sub find {
Subroutine find: called CC=4 SCAR=13.9
Pod undocumented
16 7 ▶ return nil unless $_[1] =~ $_[0];
Branch: 1 branch
BranchTrueFalseTotal
unless $_[1] =~ /$_[0]/ 2 5 7
17 5 ▶ return string($&) unless defined $1;
Branch: 1 branch
BranchTrueFalseTotal
unless defined $1 2 3 5
18 3 my ($i, @capture) = (1, string($&));
19 {
20 53 ▶ no strict 'refs';
Subroutine BEGIN: called CC=1 SCAR=0.0
21 3 ▶ while (defined (my $value = ${"$i"})) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined(my $value = ${"$i";})) 6 3 9
22 6 push @capture, string($value);
23 6 $i++;
24 }
25 }
26 3 VECTOR->new([@capture]);
27 }
28  
29 4 ▶sub matches {
Subroutine matches: called CC=1 SCAR=0.0
Pod undocumented
30 4 find REGEX->new("\\A$_[0]\\z"), $_[1];
31 }
32  
33 1 ▶sub pattern {
Subroutine pattern: called CC=1 SCAR=0.0
Pod undocumented
34 1 __PACKAGE__->new(@_);
35 }
36  
37 53 1;
« lib/Lingy/Class.pm ↑ Summary blib/lib/Lingy/Namespace.pm »