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