Data/Printer/Filter/Regexp.pm

filter: Statementstmt 88.8% 24 / 27 Branchbran 66.6% 4 / 6 Conditioncond 33.3% 1 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 100% 5 / 5 Podpod n/a totaltotal 79.0% 34 / 43 CC 5 SCAR 13.0
CC
5
Cov
81%
__ANON__
5.8
BEGIN
1.0
BEGIN
1.0
CRAP 3.7
« Data/Printer/Filter/CODE.pm ↑ Summary Data/Printer/Profile/Dumper.pm »
1 package Data::Printer::Filter::Regexp;
2 35 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 35 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 35 ▶use Data::Printer::Filter;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 35 ▶use Data::Printer::Common;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 3 ▶filter 'Regexp' => sub {
Subroutine __ANON__: called CC=5 SCAR=17.6
8 3 my ($regexp, $ddp) = @_;
9 3 my $val = "$regexp";
10 3 my $string;
11  
12 # a regex to parse a regex. Talk about full circle :)
13 # note: we are not validating anything, just grabbing modifiers
14 3 ▶ if ($val =~ m/\(\?\^?([uladxismnpogce]*)(?:\-[uladxismnpogce]+)?:(.*)\)/s) {
Branch: 1 branch
BranchTrueFalseTotal
if ($val =~ /\(\?\^?([uladxismnpogce]*)(?:\-[uladxismnpogce]+)?:(.*)\)/s) { } 3 0 3
15 3 my ($modifiers, $parsed_val) = ($1, $2);
16 3 $string = $ddp->maybe_colorize($parsed_val, 'regex');
17 3 ▶ if ($modifiers) {
Branch: 1 branch
BranchTrueFalseTotal
if ($modifiers) 2 1 3
18 2 $string .= " (modifiers: $modifiers)";
19 }
20 }
21 else {
22 0 Data::Printer::Common::_warn($ddp, "Unrecognized regex $val. Please submit a bug report for Data::Printer.");
23 0 $string = $ddp->maybe_colorize('Unknown Regexp', 'regex');
24 }
25  
26 3 ▶ if ($ddp->show_tied and my $tie = ref tied $regexp) {
Branch: 1 branch
BranchTrueFalseTotal
if ($ddp->show_tied and my $tie = ref tied $regexp) 0 3 3
Condition33%1/3
$ddp->show_tied and my $tie = ref tied $regexp
!ll&&!rl&&r
030
MC/DC0%0/2
$ddp->show_tied and my $tie = ref tied $regexp
$ddp->show_tied my $tie = ref tied $regexp
Truth table33%1/3
A and B
A= $ddp->show_tiedB= my $tie = ref tied $regexp
ABresult
0X0
100
111
27 0 $string .= " (tied to $tie)";
28 }
29 3 return $string;
30 35 };
31  
32 35 1;
« Data/Printer/Filter/CODE.pm ↑ Summary Data/Printer/Profile/Dumper.pm »