lib/Perl/ToPerl6/Transformer/Subroutines/RemovePrototypes.pm

filter: Statementstmt 89.6% 26 / 29 Branchbran 25.0% 1 / 4 Conditioncond 22.2% 2 / 9 MC/DCmcdc 0.0% 0 / 4 Subroutinesub 91.6% 11 / 12 Podpod 60.0% 3 / 5 totaltotal 68.2% 43 / 63 CC 5 SCAR 12.7
CC
5
Cov
69%
__ANON__
8.7
transform
6.0
applies_to
1.2
CRAP 3.6
« lib/Perl/ToPerl6/Transformer/RewriteSpecialLiterals.pm ↑ Summary lib/Perl/ToPerl6/Transformer/BasicTypes/Integers/RewriteHexNumbers.pm »
1 package Perl::ToPerl6::Transformer::Subroutines::RemovePrototypes;
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{Remove prototypes from subroutines};
15 17 Readonly::Scalar my $EXPL => q{Remove prototypes from subroutines};
16  
17 #-----------------------------------------------------------------------------
18  
19 17 my %map = (
20 sub => 1
21 );
22  
23 #-----------------------------------------------------------------------------
24  
25 38 ▶sub supported_parameters { return () }
Subroutine supported_parameters: called CC=1 SCAR=0.0
Pod undocumented
26 27 ▶sub default_necessity { return $NECESSITY_HIGHEST }
Subroutine default_necessity: called CC=1 SCAR=0.0
Pod documented
27 24 ▶sub default_themes { return qw( core ) }
Subroutine default_themes: called CC=1 SCAR=0.0
Pod documented
28 5 ▶sub applies_to {
Subroutine applies_to: called CC=1 SCAR=2.1
Pod documented
29 78 ▶ return sub {
Subroutine __ANON__: called CC=4 SCAR=21.7
30 $_[1]->isa('PPI::Token::Prototype') and
31 $_[1]->sprevious_sibling and
32 ( exists $map{$_[1]->sprevious_sibling->content} or
33 78 ▶ exists $map{$_[1]->sprevious_sibling->sprevious_sibling->content} )
Branch: 1 branch
BranchTrueFalseTotal
$_[1]->isa("PPI::Token::Prototype") and $_[1]->sprevious_sibling and exists $map{$_[1]->sprevious_sibling->content} || exists $map{$_[1]->sprevious_sibling->sprevious_sibling->content} 0 78 78
Condition22%2/9
$_[1]->isa('PPI::Token::Prototype') && $_[1]->sprevious_sibling && (exists $map{$_[1]->sprevious_sibling->content} || exists $map{$_[1]->sprevious_sibling->sprevious_sibling->content})
!ll&&!rl&&r
7800
$_[1]->isa("PPI::Token::Prototype") and $_[1]->sprevious_sibling
!ll&&!rl&&r
7800
exists $map{$_[1]->sprevious_sibling->content} or exists $map{$_[1]->sprevious_sibling->sprevious_sibling->content}
l!l&&r!l&&!r
000
MC/DC0%0/4
$_[1]->isa('PPI::Token::Prototype') && $_[1]->sprevious_sibling && (exists $map{$_[1]->sprevious_sibling->content} || exists $map{$_[1]->sprevious_sibling->sprevious_sibling->content})
$_[1]->isa("PPI::Token::Prototype") $_[1]->sprevious_sibling exists $map{$_[1]->sprevious_sibling->content} exists $map{$_[1]->sprevious_sibling->sprevious_sibling->content}
Truth table20%1/5
A and B && C or D
A= $_[1]->isa("PPI::Token::Prototype")B= $_[1]->sprevious_siblingC= exists $map{$_[1]->sprevious_sibling->content}D= exists $map{$_[1]->sprevious_sibling->sprevious_sibling->content}
ABCDresult
0XXX0
10XX0
11000
111X1
11011
34 }
35 5 }
36  
37 #-----------------------------------------------------------------------------
38  
39 0 ▶sub transform {
Subroutine transform: not called CC=2 SCAR=17.9
Pod undocumented
40 0 my ($self, $elem, $doc) = @_;
41  
42 0 ▶ $elem->remove unless $elem->content =~ /[a-zA-Z0-9]/;
Branch: 1 branch
BranchTrueFalseTotal
unless $elem->content =~ /[a-zA-Z0-9]/ 0 0 0
43  
44 0 return $self->transformation( $DESC, $EXPL, $elem );
45 }
46  
47 17 1;
48  
49 #-----------------------------------------------------------------------------
50  
51 __END__
« lib/Perl/ToPerl6/Transformer/RewriteSpecialLiterals.pm ↑ Summary lib/Perl/ToPerl6/Transformer/BasicTypes/Integers/RewriteHexNumbers.pm »