blib/lib/Babble/SubMatch.pm

filter: Statementstmt 100% 18 / 18 Branchbran 50.0% 1 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 4 / 4 Podpod 0.0% 0 / 2 totaltotal 88.4% 23 / 26 CC 2 SCAR 3.4
CC
2
Cov
95%
transform_text
2.0
BEGIN
1.0
replace_text
1.0
CRAP 1.4
« blib/lib/Babble/Plugin/SubstituteAndReturn.pm ↑ Summary blib/lib/Babble/Plugin/Sigify.pm »
1 package Babble::SubMatch;
2  
3 8 ▶use Mu;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 8 extends 'Babble::Match';
6  
7 8 ro 'parent';
8 8 ro 'start';
9  
10 sub replace_text {
11 82 ▶ my ($self, $new_text) = @_;
Subroutine replace_text: called CC=1 SCAR=0.0
Pod undocumented
12 82 $self->replace_substring(0, length($self->text), $new_text);
13 }
14  
15 sub transform_text {
16 20 ▶ my ($self, $code) = @_;
Subroutine transform_text: called CC=2 SCAR=7.0
Pod undocumented
17 20 local $_ = my $text = $self->text;
18 20 $code->($_);
19 20 ▶ if ($_ ne $text) { $self->replace_text($_) }
Branch: 1 branch
BranchTrueFalseTotal
if ($_ ne $text) 20 0 20
20 20 return $self;
21 }
22  
23 before replace_substring => sub {
24 151 ▶ my ($self, $start, $length, $new_text) = @_;
Subroutine __ANON__: called CC=1 SCAR=0.0
25 151 $self->parent
26 ->replace_substring($self->start + $start, $length, $new_text);
27 8 };
28  
29 8 1;
« blib/lib/Babble/Plugin/SubstituteAndReturn.pm ↑ Summary blib/lib/Babble/Plugin/Sigify.pm »