Scanner/Perl.pm

filter: Statementstmt 93.0% 175 / 188 Branchbran 90.7% 78 / 86 Conditioncond 83.7% 93 / 111 MC/DCmcdc 68.0% 49 / 72 Subroutinesub 95.0% 19 / 20 Podpod 66.6% 2 / 3 totaltotal 86.6% 416 / 480 CC 81 SCAR 42.8
CC
81
Cov
90%
_walker
90.0
scan_file
2.0
__ANON__
1.1
CRAP 72.3
↑ Summary Dictionary.pm »
1 package Localizer::Scanner::Perl;
2 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use utf8;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 1 ▶use 5.010_001;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 1 ▶use constant NUL => 0;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 1 ▶use constant BEG => 1;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 1 ▶use constant PAR => 2;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 1 ▶use constant HERE => 10;
Subroutine BEGIN: called CC=1 SCAR=0.0
11 1 ▶use constant QUO1 => 3;
Subroutine BEGIN: called CC=1 SCAR=0.0
12 1 ▶use constant QUO2 => 4;
Subroutine BEGIN: called CC=1 SCAR=0.0
13 1 ▶use constant QUO3 => 5;
Subroutine BEGIN: called CC=1 SCAR=0.0
14 1 ▶use constant QUO4 => 6;
Subroutine BEGIN: called CC=1 SCAR=0.0
15 1 ▶use constant QUO5 => 7;
Subroutine BEGIN: called CC=1 SCAR=0.0
16 1 ▶use constant QUO6 => 8;
Subroutine BEGIN: called CC=1 SCAR=0.0
17 1 ▶use constant QUO7 => 9;
Subroutine BEGIN: called CC=1 SCAR=0.0
18  
19 1 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
Pod undocumented
20 1 my $class = shift;
21 1 bless { }, $class;
22 }
23  
24 1 ▶sub scan {
Subroutine scan: called CC=1 SCAR=0.0
Pod documented
25 1 my($self, $result, $filename, $data) = @_;
26 1 $self->_walker($data, $result, $filename);
27 1 return $result;
28 }
29  
30 1 ▶sub scan_file {
Subroutine scan_file: called CC=2 SCAR=7.0
Pod documented
31 1 my ($self, $result, $filename) = @_;
32 1 ▶ open my $fh, '<:encoding(utf-8)', $filename
Branch: 1 branch
BranchTrueFalseTotal
open my $fh, "<:encoding(utf-8)", $filename or die "Cannot open file '${filename}' for reading: $!" 1 0 1
33 or die "Cannot open file '$filename' for reading: $!";
34 1 my $data = do { local $/; <$fh> };
35 1 return $self->scan($result, $filename, $data);
36 }
37  
38 # Imported from Locale::Maketext::Extract::Plugin::Perl
39 1 ▶sub _walker {
Subroutine _walker: called CC=80 SCAR=45.0
40 1 my $self = shift;
41 1 local $_ = shift;
42 1 my ($result, $filename) = @_;
43  
44 0 ▶ local $SIG{__WARN__} = sub { die @_ };
Subroutine __ANON__: not called CC=1 SCAR=1.2
45  
46 # Perl code:
47 1 my ( $state, $line_offset, $str, $str_part, $vars, $quo, $heredoc )
48 = ( 0, 0 );
49 1 my $orig = 1 + ( () = ( ( my $__ = $_ ) =~ /\n/g ) );
50  
51 PARSER: {
52 1 ▶ $_ = substr( $_, pos($_) ) if ( pos($_) );
Branch: 1 branch
BranchTrueFalseTotal
if pos $_ 316 113 429
53 429 my $line = $orig - ( () = ( ( my $__ = $_ ) =~ /\n/g ) );
54  
55 # various ways to spell the localization function
56 $state == NUL
57 && m/\b(translate|maketext|gettext|__?|loc(?:ali[sz]e)?|l|x)/gc
58 429 ▶ && do { $state = BEG; redo };
Branch: 1 branch
BranchTrueFalseTotal
$state == 0 and /\b(translate|maketext|gettext|__?|loc(?:ali[sz]e)?|l|x)/cg and do { $state = 1; redo } 57 372 429
Condition100%3/3
$state == 0 and /\b(translate|maketext|gettext|__?|loc(?:ali[sz]e)?|l|x)/cg
!ll&&!rl&&r
371157
MC/DC100%2/2
$state == 0 and /\b(translate|maketext|gettext|__?|loc(?:ali[sz]e)?|l|x)/cg
$state == 0 /\b(translate|maketext|gettext|__?|loc(?:ali[sz]e)?|l|x)/cg
Truth table100%3/3
A and B
A= $state == 0B= /\b(translate|maketext|gettext|__?|loc(?:ali[sz]e)?|l|x)/cg
ABresult
0X0
100
111
59 372 ▶ $state == BEG && m/^([\s\t\n]*)/gc && redo;
Branch: 1 branch
BranchTrueFalseTotal
$state == 1 and /^([\s\t\n]*)/cg and redo 59 313 372
Condition100%3/3
$state == 1 and /^([\s\t\n]*)/cg
!ll&&!rl&&r
2565759
MC/DC100%2/2
$state == 1 and /^([\s\t\n]*)/cg
$state == 1 /^([\s\t\n]*)/cg
Truth table100%3/3
A and B
A= $state == 1B= /^([\s\t\n]*)/cg
ABresult
0X0
100
111
60  
61 # begin ()
62 $state == BEG
63 && m/^([\S\(])\s*/gc
64 313 ▶ && do { $state = ( ( $1 eq '(' ) ? PAR : NUL ); redo };
Branch: 2 branches
BranchTrueFalseTotal
$state == 1 and /^([\S\(])\s*/cg and do { $state = $1 eq "(" ? 2 : 0; redo } 57 256 313
$1 eq '(' ? : 43 14 57
Condition66%2/3
$state == 1 and /^([\S\(])\s*/cg
!ll&&!rl&&r
256057
MC/DC50%1/2
$state == 1 and /^([\S\(])\s*/cg
$state == 1 /^([\S\(])\s*/cg
Truth table66%2/3
A and B
A= $state == 1B= /^([\S\(])\s*/cg
ABresult
0X0
100
111
65  
66 # concat
67 $state == PAR
68 && defined($str)
69 && m/^(\s*\.\s*)/gc
70 0 ▶ && do { $line_offset += ( () = ( ( my $__ = $1 ) =~ /\n/g ) ); redo };
Branch: 1 branch
BranchTrueFalseTotal
$state == 2 and defined $str and /^(\s*\.\s*)/cg and do { $line_offset += () = (my $__ = $1) =~ /\n/g; redo } 0 256 256
Condition83%5/6
$state == 2 and defined $str and /^(\s*\.\s*)/cg
!ll&&!rl&&r
214420
$state == 2 and defined $str
!ll&&!rl&&r
1278742
MC/DC0%0/3
$state == 2 and defined $str and /^(\s*\.\s*)/cg
$state == 2 defined $str /^(\s*\.\s*)/cg
Truth table75%3/4
A and B and C
A= $state == 2B= defined $strC= /^(\s*\.\s*)/cg
ABCresult
0XX0
10X0
1100
1111
71  
72 # str_part
73 256 ▶ $state == PAR && defined($str_part) && do {
Branch: 1 branch
BranchTrueFalseTotal
$state == 2 and defined $str_part and do { if ($quo == 3 or $quo == 7) { $str_part =~ s/\\([\\'])/$1/g if $str_part; } elsif ($quo != 8) { $str_part =~ s/(\\(?:[0x]..|c?.))/"qq($1)";/gee if $str_part; } ; $str .= $str_part; undef $str_part; undef $quo; redo } 42 214 256
Condition100%3/3
$state == 2 and defined $str_part
!ll&&!rl&&r
1278742
MC/DC100%2/2
$state == 2 and defined $str_part
$state == 2 defined $str_part
Truth table100%3/3
A and B
A= $state == 2B= defined $str_part
ABresult
0X0
100
111
74 42 ▶ if ( ( $quo == QUO1 ) || ( $quo == QUO5 ) ) {
Branch: 2 branches
BranchTrueFalseTotal
if ($quo == 3 or $quo == 7) { } 18 24 42
elsif ($quo != 8) { } 23 1 24
Condition100%3/3
$quo == 3 or $quo == 7
l!l&&r!l&&!r
12624
MC/DC100%2/2
$quo == 3 or $quo == 7
$quo == 3 $quo == 7
Truth table100%3/3
A or B
A= $quo == 3B= $quo == 7
ABresult
1X1
011
000
75 18 ▶ $str_part =~ s/\\([\\'])/$1/g
Branch: 1 branch
BranchTrueFalseTotal
if $str_part 18 0 18
76 if ($str_part); # normalize q strings
77 }
78 elsif ( $quo != QUO6 ) {
79 23 ▶ $str_part =~ s/(\\(?:[0x]..|c?.))/"qq($1)"/eeg
Branch: 1 branch
BranchTrueFalseTotal
if $str_part 22 1 23
80 if ($str_part); # normalize qq / qx strings
81 }
82 42 $str .= $str_part;
83 42 undef $str_part;
84 42 undef $quo;
85 42 redo;
86 };
87  
88 # begin or end of string
89 214 ▶ $state == PAR && m/^(\')/gc && do { $state = $quo = QUO1; redo };
Branch: 1 branch
BranchTrueFalseTotal
$state == 2 and /^(\')/cg and do { $state = ($quo = 3); redo } 12 202 214
Condition100%3/3
$state == 2 and /^(\')/cg
!ll&&!rl&&r
1277512
MC/DC100%2/2
$state == 2 and /^(\')/cg
$state == 2 /^(\')/cg
Truth table100%3/3
A and B
A= $state == 2B= /^(\')/cg
ABresult
0X0
100
111
90 202 ▶ $state == QUO1 && m/^([^'\\]+)/gc && do { $str_part .= $1; redo };
Branch: 1 branch
BranchTrueFalseTotal
$state == 3 and /^([^'\\]+)/cg and do { $str_part .= $1; redo } 20 182 202
Condition100%3/3
$state == 3 and /^([^'\\]+)/cg
!ll&&!rl&&r
1622020
MC/DC100%2/2
$state == 3 and /^([^'\\]+)/cg
$state == 3 /^([^'\\]+)/cg
Truth table100%3/3
A and B
A= $state == 3B= /^([^'\\]+)/cg
ABresult
0X0
100
111
91 182 ▶ $state == QUO1 && m/^((?:\\.)+)/gcs && do { $str_part .= $1; redo };
Branch: 1 branch
BranchTrueFalseTotal
$state == 3 and /^((?:\\.)+)/cgs and do { $str_part .= $1; redo } 8 174 182
Condition100%3/3
$state == 3 and /^((?:\\.)+)/cgs
!ll&&!rl&&r
162128
MC/DC100%2/2
$state == 3 and /^((?:\\.)+)/cgs
$state == 3 /^((?:\\.)+)/cgs
Truth table100%3/3
A and B
A= $state == 3B= /^((?:\\.)+)/cgs
ABresult
0X0
100
111
92 174 ▶ $state == QUO1 && m/^\'/gc && do { $state = PAR; redo };
Branch: 1 branch
BranchTrueFalseTotal
$state == 3 and /^\'/cg and do { $state = 2; redo } 12 162 174
Condition66%2/3
$state == 3 and /^\'/cg
!ll&&!rl&&r
162012
MC/DC50%1/2
$state == 3 and /^\'/cg
$state == 3 /^\'/cg
Truth table66%2/3
A and B
A= $state == 3B= /^\'/cg
ABresult
0X0
100
111
93  
94 162 ▶ $state == PAR && m/^\"/gc && do { $state = $quo = QUO2; redo };
Branch: 1 branch
BranchTrueFalseTotal
$state == 2 and /^\"/cg and do { $state = ($quo = 4); redo } 18 144 162
Condition100%3/3
$state == 2 and /^\"/cg
!ll&&!rl&&r
875718
MC/DC100%2/2
$state == 2 and /^\"/cg
$state == 2 /^\"/cg
Truth table100%3/3
A and B
A= $state == 2B= /^\"/cg
ABresult
0X0
100
111
95 144 ▶ $state == QUO2 && m/^([^"\\]+)/gc && do { $str_part .= $1; redo };
Branch: 1 branch
BranchTrueFalseTotal
$state == 4 and /^([^"\\]+)/cg and do { $str_part .= $1; redo } 26 118 144
Condition100%3/3
$state == 4 and /^([^"\\]+)/cg
!ll&&!rl&&r
902826
MC/DC100%2/2
$state == 4 and /^([^"\\]+)/cg
$state == 4 /^([^"\\]+)/cg
Truth table100%3/3
A and B
A= $state == 4B= /^([^"\\]+)/cg
ABresult
0X0
100
111
96 118 ▶ $state == QUO2 && m/^((?:\\.)+)/gcs && do { $str_part .= $1; redo };
Branch: 1 branch
BranchTrueFalseTotal
$state == 4 and /^((?:\\.)+)/cgs and do { $str_part .= $1; redo } 10 108 118
Condition100%3/3
$state == 4 and /^((?:\\.)+)/cgs
!ll&&!rl&&r
901810
MC/DC100%2/2
$state == 4 and /^((?:\\.)+)/cgs
$state == 4 /^((?:\\.)+)/cgs
Truth table100%3/3
A and B
A= $state == 4B= /^((?:\\.)+)/cgs
ABresult
0X0
100
111
97 108 ▶ $state == QUO2 && m/^\"/gc && do { $state = PAR; redo };
Branch: 1 branch
BranchTrueFalseTotal
$state == 4 and /^\"/cg and do { $state = 2; redo } 18 90 108
Condition66%2/3
$state == 4 and /^\"/cg
!ll&&!rl&&r
90018
MC/DC50%1/2
$state == 4 and /^\"/cg
$state == 4 /^\"/cg
Truth table66%2/3
A and B
A= $state == 4B= /^\"/cg
ABresult
0X0
100
111
98  
99 0 ▶ $state == PAR && m/^\`/gc && do { $state = $quo = QUO3; redo };
Branch: 1 branch
BranchTrueFalseTotal
$state == 2 and /^\`/cg and do { $state = ($quo = 5); redo } 0 90 90
Condition66%2/3
$state == 2 and /^\`/cg
!ll&&!rl&&r
33570
MC/DC0%0/2
$state == 2 and /^\`/cg
$state == 2 /^\`/cg
Truth table66%2/3
A and B
A= $state == 2B= /^\`/cg
ABresult
0X0
100
111
100 0 ▶ $state == QUO3 && m/^([^\`]*)/gc && do { $str_part .= $1; redo };
Branch: 1 branch
BranchTrueFalseTotal
$state == 5 and /^([^\`]*)/cg and do { $str_part .= $1; redo } 0 90 90
Condition33%1/3
$state == 5 and /^([^\`]*)/cg
!ll&&!rl&&r
9000
MC/DC0%0/2
$state == 5 and /^([^\`]*)/cg
$state == 5 /^([^\`]*)/cg
Truth table33%1/3
A and B
A= $state == 5B= /^([^\`]*)/cg
ABresult
0X0
100
111
101 0 ▶ $state == QUO3 && m/^\`/gc && do { $state = PAR; redo };
Branch: 1 branch
BranchTrueFalseTotal
$state == 5 and /^\`/cg and do { $state = 2; redo } 0 90 90
Condition33%1/3
$state == 5 and /^\`/cg
!ll&&!rl&&r
9000
MC/DC0%0/2
$state == 5 and /^\`/cg
$state == 5 /^\`/cg
Truth table33%1/3
A and B
A= $state == 5B= /^\`/cg
ABresult
0X0
100
111
102  
103 90 ▶ $state == PAR && m/^qq\{/gc && do { $state = $quo = QUO4; redo };
Branch: 1 branch
BranchTrueFalseTotal
$state == 2 and /^qq\{/cg and do { $state = ($quo = 6); redo } 1 89 90
Condition100%3/3
$state == 2 and /^qq\{/cg
!ll&&!rl&&r
33561
MC/DC100%2/2
$state == 2 and /^qq\{/cg
$state == 2 /^qq\{/cg
Truth table100%3/3
A and B
A= $state == 2B= /^qq\{/cg
ABresult
0X0
100
111
104 89 ▶ $state == QUO4 && m/^([^\}]*)/gc && do { $str_part .= $1; redo };
Branch: 1 branch
BranchTrueFalseTotal
$state == 6 and /^([^\}]*)/cg and do { $str_part .= $1; redo } 2 87 89
Condition100%3/3
$state == 6 and /^([^\}]*)/cg
!ll&&!rl&&r
8612
MC/DC100%2/2
$state == 6 and /^([^\}]*)/cg
$state == 6 /^([^\}]*)/cg
Truth table100%3/3
A and B
A= $state == 6B= /^([^\}]*)/cg
ABresult
0X0
100
111
105 87 ▶ $state == QUO4 && m/^\}/gc && do { $state = PAR; redo };
Branch: 1 branch
BranchTrueFalseTotal
$state == 6 and /^\}/cg and do { $state = 2; redo } 1 86 87
Condition66%2/3
$state == 6 and /^\}/cg
!ll&&!rl&&r
8601
MC/DC50%1/2
$state == 6 and /^\}/cg
$state == 6 /^\}/cg
Truth table66%2/3
A and B
A= $state == 6B= /^\}/cg
ABresult
0X0
100
111
106  
107 86 ▶ $state == PAR && m/^q\{/gc && do { $state = $quo = QUO5; redo };
Branch: 1 branch
BranchTrueFalseTotal
$state == 2 and /^q\{/cg and do { $state = ($quo = 7); redo } 6 80 86
Condition100%3/3
$state == 2 and /^q\{/cg
!ll&&!rl&&r
30506
MC/DC100%2/2
$state == 2 and /^q\{/cg
$state == 2 /^q\{/cg
Truth table100%3/3
A and B
A= $state == 2B= /^q\{/cg
ABresult
0X0
100
111
108 80 ▶ $state == QUO5 && m/^([^\}]*)/gc && do { $str_part .= $1; redo };
Branch: 1 branch
BranchTrueFalseTotal
$state == 7 and /^([^\}]*)/cg and do { $str_part .= $1; redo } 12 68 80
Condition100%3/3
$state == 7 and /^([^\}]*)/cg
!ll&&!rl&&r
62612
MC/DC100%2/2
$state == 7 and /^([^\}]*)/cg
$state == 7 /^([^\}]*)/cg
Truth table100%3/3
A and B
A= $state == 7B= /^([^\}]*)/cg
ABresult
0X0
100
111
109 68 ▶ $state == QUO5 && m/^\}/gc && do { $state = PAR; redo };
Branch: 1 branch
BranchTrueFalseTotal
$state == 7 and /^\}/cg and do { $state = 2; redo } 6 62 68
Condition66%2/3
$state == 7 and /^\}/cg
!ll&&!rl&&r
6206
MC/DC50%1/2
$state == 7 and /^\}/cg
$state == 7 /^\}/cg
Truth table66%2/3
A and B
A= $state == 7B= /^\}/cg
ABresult
0X0
100
111
110  
111 # find heredoc terminator, then get the
112 #heredoc and go back to current position
113 $state == PAR
114 && m/^<<\s*\'/gc
115 62 ▶ && do { $state = $quo = QUO6; $heredoc = ''; redo };
Branch: 1 branch
BranchTrueFalseTotal
$state == 2 and /^<<\s*\'/cg and do { $state = ($quo = 8); $heredoc = ""; redo } 1 61 62
Condition100%3/3
$state == 2 and /^<<\s*\'/cg
!ll&&!rl&&r
12491
MC/DC100%2/2
$state == 2 and /^<<\s*\'/cg
$state == 2 /^<<\s*\'/cg
Truth table100%3/3
A and B
A= $state == 2B= /^<<\s*\'/cg
ABresult
0X0
100
111
116 61 ▶ $state == QUO6 && m/^([^'\\\n]+)/gc && do { $heredoc .= $1; redo };
Branch: 1 branch
BranchTrueFalseTotal
$state == 8 and /^([^'\\\n]+)/cg and do { $heredoc .= $1; redo } 1 60 61
Condition100%3/3
$state == 8 and /^([^'\\\n]+)/cg
!ll&&!rl&&r
5911
MC/DC100%2/2
$state == 8 and /^([^'\\\n]+)/cg
$state == 8 /^([^'\\\n]+)/cg
Truth table100%3/3
A and B
A= $state == 8B= /^([^'\\\n]+)/cg
ABresult
0X0
100
111
117 0 ▶ $state == QUO6 && m/^((?:\\.)+)/gc && do { $heredoc .= $1; redo };
Branch: 1 branch
BranchTrueFalseTotal
$state == 8 and /^((?:\\.)+)/cg and do { $heredoc .= $1; redo } 0 60 60
Condition66%2/3
$state == 8 and /^((?:\\.)+)/cg
!ll&&!rl&&r
5910
MC/DC0%0/2
$state == 8 and /^((?:\\.)+)/cg
$state == 8 /^((?:\\.)+)/cg
Truth table66%2/3
A and B
A= $state == 8B= /^((?:\\.)+)/cg
ABresult
0X0
100
111
118 $state == QUO6
119 && m/^\'/gc
120 60 ▶ && do { $state = HERE; $heredoc =~ s/\\\'/\'/g; redo };
Branch: 1 branch
BranchTrueFalseTotal
$state == 8 and /^\'/cg and do { $state = 10; $heredoc =~ s/\\\'/'/g; redo } 1 59 60
Condition66%2/3
$state == 8 and /^\'/cg
!ll&&!rl&&r
5901
MC/DC50%1/2
$state == 8 and /^\'/cg
$state == 8 /^\'/cg
Truth table66%2/3
A and B
A= $state == 8B= /^\'/cg
ABresult
0X0
100
111
121  
122 $state == PAR
123 && m/^<<\s*\"/gc
124 59 ▶ && do { $state = $quo = QUO7; $heredoc = ''; redo };
Branch: 1 branch
BranchTrueFalseTotal
$state == 2 and /^<<\s*\"/cg and do { $state = ($quo = 9); $heredoc = ""; redo } 2 57 59
Condition100%3/3
$state == 2 and /^<<\s*\"/cg
!ll&&!rl&&r
10472
MC/DC100%2/2
$state == 2 and /^<<\s*\"/cg
$state == 2 /^<<\s*\"/cg
Truth table100%3/3
A and B
A= $state == 2B= /^<<\s*\"/cg
ABresult
0X0
100
111
125 57 ▶ $state == QUO7 && m/^([^"\\\n]+)/gc && do { $heredoc .= $1; redo };
Branch: 1 branch
BranchTrueFalseTotal
$state == 9 and /^([^"\\\n]+)/cg and do { $heredoc .= $1; redo } 1 56 57
Condition100%3/3
$state == 9 and /^([^"\\\n]+)/cg
!ll&&!rl&&r
5421
MC/DC100%2/2
$state == 9 and /^([^"\\\n]+)/cg
$state == 9 /^([^"\\\n]+)/cg
Truth table100%3/3
A and B
A= $state == 9B= /^([^"\\\n]+)/cg
ABresult
0X0
100
111
126 0 ▶ $state == QUO7 && m/^((?:\\.)+)/gc && do { $heredoc .= $1; redo };
Branch: 1 branch
BranchTrueFalseTotal
$state == 9 and /^((?:\\.)+)/cg and do { $heredoc .= $1; redo } 0 56 56
Condition66%2/3
$state == 9 and /^((?:\\.)+)/cg
!ll&&!rl&&r
5420
MC/DC0%0/2
$state == 9 and /^((?:\\.)+)/cg
$state == 9 /^((?:\\.)+)/cg
Truth table66%2/3
A and B
A= $state == 9B= /^((?:\\.)+)/cg
ABresult
0X0
100
111
127 $state == QUO7
128 && m/^\"/gc
129 56 ▶ && do { $state = HERE; $heredoc =~ s/\\\"/\"/g; redo };
Branch: 1 branch
BranchTrueFalseTotal
$state == 9 and /^\"/cg and do { $state = 10; $heredoc =~ s/\\\"/"/g; redo } 2 54 56
Condition66%2/3
$state == 9 and /^\"/cg
!ll&&!rl&&r
5402
MC/DC50%1/2
$state == 9 and /^\"/cg
$state == 9 /^\"/cg
Truth table66%2/3
A and B
A= $state == 9B= /^\"/cg
ABresult
0X0
100
111
130  
131 $state == PAR
132 && m/^<<(\w*)/gc
133 54 ▶ && do { $state = HERE; $quo = QUO7; $heredoc = $1; redo };
Branch: 1 branch
BranchTrueFalseTotal
$state == 2 and /^<<(\w*)/cg and do { $state = 10; $quo = 9; $heredoc = $1; redo } 3 51 54
Condition100%3/3
$state == 2 and /^<<(\w*)/cg
!ll&&!rl&&r
7443
MC/DC100%2/2
$state == 2 and /^<<(\w*)/cg
$state == 2 /^<<(\w*)/cg
Truth table100%3/3
A and B
A= $state == 2B= /^<<(\w*)/cg
ABresult
0X0
100
111
134  
135 # jump ahead and get the heredoc, then s/// also
136 # resets the pos and we are back at the current pos
137 $state == HERE
138 && m/^.*\r?\n/gc
139 && s/\G(.*?\r?\n)$heredoc(\r?\n)//s
140 51 ▶ && do { $state = PAR; $str_part .= $1; $line_offset++; redo };
Branch: 1 branch
BranchTrueFalseTotal
$state == 10 and /^.*\r?\n/cg and s/\G(.*?\r?\n)$heredoc(\r?\n)//s and do { $state = 2; $str_part .= $1; ++$line_offset; redo } 6 45 51
Condition66%4/6
$state == 10 and /^.*\r?\n/cg and s/\G(.*?\r?\n)$heredoc(\r?\n)//s
!ll&&!rl&&r
4506
$state == 10 and /^.*\r?\n/cg
!ll&&!rl&&r
4506
MC/DC33%1/3
$state == 10 and /^.*\r?\n/cg and s/\G(.*?\r?\n)$heredoc(\r?\n)//s
$state == 10 /^.*\r?\n/cg s/\G(.*?\r?\n)$heredoc(\r?\n)//s
Truth table50%2/4
A and B and C
A= $state == 10B= /^.*\r?\n/cgC= s/\G(.*?\r?\n)$heredoc(\r?\n)//s
ABCresult
0XX0
10X0
1100
1111
141  
142 # end ()
143 #
144  
145 45 ▶ $state == PAR && m/^\s*[\)]/gc && do {
Branch: 1 branch
BranchTrueFalseTotal
$state == 2 and /^\s*[\)]/cg and do { $state = 0; $vars =~ s/[\n\r]//g if $vars; if ($str) { $result->add_entry_position($str, $filename, $line - $line_offset); } ; undef $str; undef $vars; undef $heredoc; $line_offset = 0; redo } 43 2 45
Condition100%3/3
$state == 2 and /^\s*[\)]/cg
!ll&&!rl&&r
1143
MC/DC100%2/2
$state == 2 and /^\s*[\)]/cg
$state == 2 /^\s*[\)]/cg
Truth table100%3/3
A and B
A= $state == 2B= /^\s*[\)]/cg
ABresult
0X0
100
111
146 43 $state = NUL;
147 43 ▶ $vars =~ s/[\n\r]//g if ($vars);
Branch: 1 branch
BranchTrueFalseTotal
if $vars 1 42 43
148  
149 43 ▶ if ($str) {
Branch: 1 branch
BranchTrueFalseTotal
if ($str) 41 2 43
150 41 $result->add_entry_position( $str, $filename, $line - $line_offset ) # <= [MODIFIED] remove mystery line modifier
151 }
152 43 undef $str;
153 43 undef $vars;
154 43 undef $heredoc;
155 43 $line_offset = 0;
156 43 redo;
157 };
158  
159 # a line of vars
160 2 ▶ $state == PAR && m/^([^\)]*)/gc && do { $vars .= "$1\n"; redo };
Branch: 1 branch
BranchTrueFalseTotal
$state == 2 and /^([^\)]*)/cg and do { $vars .= "$1\n"; redo } 1 1 2
Condition66%2/3
$state == 2 and /^([^\)]*)/cg
!ll&&!rl&&r
101
MC/DC50%1/2
$state == 2 and /^([^\)]*)/cg
$state == 2 /^([^\)]*)/cg
Truth table66%2/3
A and B
A= $state == 2B= /^([^\)]*)/cg
ABresult
0X0
100
111
161 }
162  
163 1 return $result;
164 }
165  
166 1 1;
167 __END__
↑ Summary Dictionary.pm »