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/SKT.pm »
1 package Babble::SubMatch;
2  
3 6 ▶use Mu;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 6 extends 'Babble::Match';
6  
7 6 ro 'parent';
8 6 ro 'start';
9  
10 sub replace_text {
11 68 ▶ my ($self, $new_text) = @_;
Subroutine replace_text: called CC=1 SCAR=0.0
Pod undocumented
12 68 $self->replace_substring(0, length($self->text), $new_text);
13 }
14  
15 sub transform_text {
16 14 ▶ my ($self, $code) = @_;
Subroutine transform_text: called CC=2 SCAR=7.0
Pod undocumented
17 14 local $_ = my $text = $self->text;
18 14 $code->($_);
19 14 ▶ if ($_ ne $text) { $self->replace_text($_) }
Branch: 1 branch
BranchTrueFalseTotal
if ($_ ne $text) 14 0 14
20 14 return $self;
21 }
22  
23 before replace_substring => sub {
24 129 ▶ my ($self, $start, $length, $new_text) = @_;
Subroutine __ANON__: called CC=1 SCAR=0.0
25 129 $self->parent
26 ->replace_substring($self->start + $start, $length, $new_text);
27 6 };
28  
29 6 1;
« blib/lib/Babble/Plugin/SubstituteAndReturn.pm ↑ Summary blib/lib/Babble/Plugin/SKT.pm »