lib/Perl/ToPerl6/Transformer/BasicTypes/Strings/AddWhitespace.pm

filter: Statementstmt 83.3% 25 / 30 Branchbran 50.0% 1 / 2 Conditioncond 66.6% 2 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 91.6% 11 / 12 Podpod 60.0% 3 / 5 totaltotal 77.7% 42 / 54 CC 3 SCAR 4.5
CC
3
Cov
80%
__ANON__
3.3
transform
2.0
applies_to
1.0
CRAP 1.6
« lib/Perl/ToPerl6/TransformerParameter/Behavior/Boolean.pm ↑ Summary lib/Perl/ToPerl6/ThemeListing.pm »
1 package Perl::ToPerl6::Transformer::BasicTypes::Strings::AddWhitespace;
2  
3 17 ▶use 5.006001;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 17 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 17 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 17 ▶use Readonly;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 17 ▶use Perl::ToPerl6::Utils qw{ :severities };
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 17 ▶use base 'Perl::ToPerl6::Transformer';
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12 #-----------------------------------------------------------------------------
13  
14 17 Readonly::Scalar my $DESC => q{Rewrite interpolated strings};
15 17 Readonly::Scalar my $EXPL => q{Rewrite interpolated strings};
16  
17 #-----------------------------------------------------------------------------
18  
19 38 ▶sub supported_parameters { return () }
Subroutine supported_parameters: called CC=1 SCAR=0.0
Pod undocumented
20 27 ▶sub default_necessity { return $NECESSITY_HIGHEST }
Subroutine default_necessity: called CC=1 SCAR=0.0
Pod documented
21 24 ▶sub default_themes { return qw( core ) }
Subroutine default_themes: called CC=1 SCAR=0.0
Pod documented
22 5 ▶sub applies_to {
Subroutine applies_to: called CC=1 SCAR=0.2
Pod documented
23 78 ▶ return sub {
Subroutine __ANON__: called CC=3 SCAR=12.0
24 $_[1]->isa('PPI::Token::Quote') and
25 $_[1]->{operator} and
26 78 ▶ $_[1]->{operator} =~ / ^ q /x
Branch: 1 branch
BranchTrueFalseTotal
$_[1]->isa("PPI::Token::Quote") and $_[1]{"operator"} and $_[1]{"operator"} =~ / ^ q /x 0 78 78
Condition66%2/3
$_[1]->isa("PPI::Token::Quote") and $_[1]{"operator"}
!ll&&!rl&&r
7530
MC/DC0%0/2
$_[1]->isa("PPI::Token::Quote") and $_[1]{"operator"}
$_[1]->isa("PPI::Token::Quote") $_[1]{"operator"}
Truth table66%2/3
A and B
A= $_[1]->isa("PPI::Token::Quote")B= $_[1]{"operator"}
ABresult
0X0
100
111
27 }
28 5 }
29  
30 #-----------------------------------------------------------------------------
31  
32 0 ▶sub transform {
Subroutine transform: not called CC=1 SCAR=6.9
Pod undocumented
33 0 my ($self, $elem, $doc) = @_;
34  
35 0 my $new_content = $elem->content;
36  
37 0 $new_content =~ s{ ^ (q?q)[(] }{$1 (}x;
38  
39 0 $elem->set_content( $new_content );
40  
41 0 return $self->transformation( $DESC, $EXPL, $elem );
42 }
43  
44 17 1;
45  
46 #-----------------------------------------------------------------------------
47  
48 __END__
« lib/Perl/ToPerl6/TransformerParameter/Behavior/Boolean.pm ↑ Summary lib/Perl/ToPerl6/ThemeListing.pm »