Babble/Plugin/Sigify.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 / 1 totaltotal 92.0% 23 / 25 CC 2 SCAR 3.4
CC
2
Cov
95%
__ANON__
2.0
transform_to_plain
1.0
BEGIN
1.0
CRAP 1.4
« Babble/SubMatch.pm ↑ Summary Babble/Plugin/SKT.pm »
1 package Babble::Plugin::Sigify;
2  
3 1 ▶use strictures 2;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 2 ▶sub transform_to_plain {
Subroutine transform_to_plain: called CC=1 SCAR=0.0
Pod undocumented
7 2 my ($self, $top) = @_;
8 2 ▶ my $tf = sub {
Subroutine __ANON__: called CC=2 SCAR=7.0
9 2 my ($m) = @_;
10 2 my $body = $m->submatches->{body}->text;
11 2 $body =~ s/^\s+//;
12 2 ▶ if ($body =~ s/^\{\s*my\s*(\([^\)]+\))\s*=\s*\@_\s*;/{/sm) {
Branch: 1 branch
BranchTrueFalseTotal
if ($body =~ s/^\{\s*my\s*(\([^\)]+\))\s*=\s*\@_\s*;/{/ms) 2 0 2
13 2 my $sig = $1;
14 2 $body =~ s/^{\n\n/{\n/;
15 2 $m->submatches->{body}->replace_text($sig.' '.$body);
16 }
17 2 };
18 2 $top->each_match_within('SubroutineDeclaration' => [
19 'sub \b (?&PerlOWS) (?&PerlOldQualifiedIdentifier) (?&PerlOWS)',
20 '(?: (?>(?&PerlAttributes)) (?&PerlOWS) )?+',
21 [ body => '(?&PerlBlock)' ], '(?&PerlOWS)'
22 ] => $tf);
23 2 $top->each_match_within('AnonymousSubroutine' => [
24 'sub \b (?&PerlOWS)',
25 '(?: (?>(?&PerlAttributes)) (?&PerlOWS) )?+',
26 [ body => '(?&PerlBlock)' ], '(?&PerlOWS)'
27 ] => $tf);
28 }
29  
30 1 1;
31 __END__
« Babble/SubMatch.pm ↑ Summary Babble/Plugin/SKT.pm »