lib/Perl/ToPerl6/Transformer/BasicTypes/Rationals/AddTrailingZero.pm

filter: Statementstmt 77.4% 24 / 31 Branchbran 0.0% 0 / 2 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 90.9% 10 / 11 Podpod 60.0% 3 / 5 totaltotal 68.5% 37 / 54 CC 3 SCAR 12.6
CC
3
Cov
67%
transform
12.0
BEGIN
1.0
BEGIN
1.0
CRAP 3.5
« lib/Perl/ToPerl6/Transformer/BasicTypes/Integers/RewriteHexNumbers.pm ↑ Summary lib/Perl/ToPerl6/Transformer/CompoundStatements/AddWhitespace.pm »
1 package Perl::ToPerl6::Transformer::BasicTypes::Rationals::AddTrailingZero;
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{Add trailing 0 after decimal point};
15 17 Readonly::Scalar my $EXPL => q{'1.' is no longer a valid floating-point number fomat};
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 { return 'PPI::Token::Number::Float' }
Subroutine applies_to: called CC=1 SCAR=0.0
Pod documented
23  
24 #-----------------------------------------------------------------------------
25  
26 0 ▶sub transform {
Subroutine transform: not called CC=3 SCAR=24.8
Pod undocumented
27 0 my ($self, $elem, $doc) = @_;
28  
29 0 my $old_content = $elem->content;
30
31 0 my ( $lhs, $rhs ) = split( /\./, $old_content );
32 0 ▶ return if $rhs and $rhs ne '';
Branch: 1 branch
BranchTrueFalseTotal
if $rhs and $rhs ne "" 0 0 0
Condition0%0/3
$rhs and $rhs ne ""
!ll&&!rl&&r
000
MC/DC0%0/2
$rhs and $rhs ne ""
$rhs $rhs ne ""
Truth table0%0/3
A and B
A= $rhsB= $rhs ne ""
ABresult
0X0
100
111
33
34 0 my $new_content = $lhs . '.0';
35
36 0 $elem->set_content( $new_content );
37  
38 0 return $self->transformation( $DESC, $EXPL, $elem );
39 }
40  
41 17 1;
42  
43 #-----------------------------------------------------------------------------
44  
45 __END__
« lib/Perl/ToPerl6/Transformer/BasicTypes/Integers/RewriteHexNumbers.pm ↑ Summary lib/Perl/ToPerl6/Transformer/CompoundStatements/AddWhitespace.pm »