blib/lib/App/Asciio/Cross.pm

filter: Statementstmt 31.0% 85 / 274 Branchbran 0.0% 0 / 92 Conditioncond 0.0% 0 / 198 MC/DCmcdc 0.0% 0 / 91 Subroutinesub 13.4% 9 / 67 Podpod 0.0% 0 / 8 totaltotal 12.8% 94 / 730 CC 119 SCAR 53.0
CC
119
Cov
15%
scene_cross
600.0
get_cross_mode_overlays
380.0
get_ascii_array_and_crossings
272.0
CRAP 199.8
« blib/lib/App/Asciio/Setup.pm ↑ Summary blib/lib/App/Asciio/GTK/Asciio.pm »
1  
2 package App::Asciio::Cross ;
3  
4 4 $|++ ;
5  
6 4 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 4 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 4 ▶use utf8;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 4 ▶use Clone;
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12 4 ▶use List::Util qw(first) ;
Subroutine BEGIN: called CC=1 SCAR=0.0
13 4 ▶use List::MoreUtils qw(any) ;
Subroutine BEGIN: called CC=1 SCAR=0.0
14  
15 4 ▶use App::Asciio::String ;
Subroutine BEGIN: called CC=1 SCAR=0.0
16 4 ▶use App::Asciio::Markup ;
Subroutine BEGIN: called CC=1 SCAR=0.0
17  
18  
19 sub get_ascii_array_and_crossings
20 0 ▶{
Subroutine get_ascii_array_and_crossings: not called CC=16 SCAR=56.1
Pod undocumented
21 0 my ($asciio, $cross_filler_chars, $start_x, $end_x, $start_y, $end_y) = @_ ;
22  
23 0 my (@lines, @cross_point_index) ;
24  
25 0 for my $element (@{$asciio->{ELEMENTS}})
26 {
27 0 ▶ next if any { $_ eq ref($element) } @{$asciio->{CROSS_MODE_IGNORE}} ;
Subroutine __ANON__: not called CC=1 SCAR=6.9
Branch: 1 branch
BranchTrueFalseTotal
if &any(sub { $_ eq ref $element; } , @{$$asciio{"CROSS_MODE_IGNORE"};}) 0 0 0
28
29 0 for my $strip (@{$element->get_stripes()})
30 {
31 0 my $line_index = -1 ;
32
33 0 for my $sub_strip (split("\n", $strip->{TEXT}))
34 {
35 0 $line_index++ ;
36
37 0 my $y = $element->{Y} + $strip->{Y_OFFSET} + $line_index ;
38
39 0 ▶ next if defined $start_y && ($y < $start_y || $y >= $end_y) ;
Branch: 1 branch
BranchTrueFalseTotal
if defined $start_y and $y < $start_y || $y >= $end_y 0 0 0
Condition0%0/6
defined $start_y and $y < $start_y || $y >= $end_y
!ll&&!rl&&r
000
$y < $start_y or $y >= $end_y
l!l&&r!l&&!r
000
MC/DC0%0/3
defined $start_y and $y < $start_y || $y >= $end_y
defined $start_y $y < $start_y $y >= $end_y
Truth table0%0/4
A and B or C
A= defined $start_yB= $y < $start_yC= $y >= $end_y
ABCresult
0XX0
1000
11X1
1011
40
41 0 $sub_strip = $USE_MARKUP_CLASS->delete_markup_characters($sub_strip) ;
42
43 0 my $character_index = 0 ;
44
45 0 for my $character (split '', $sub_strip)
46 {
47 0 my $x = $element->{X} + $strip->{X_OFFSET} + $character_index ;
48
49 0 ▶ if((defined $start_x) && ($x < $start_x || $x >= $end_x))
Branch: 2 branches
BranchTrueFalseTotal
if (defined $start_x and $x < $start_x || $x >= $end_x) { } 0 0 0
elsif ($x >= 0 and $y >= 0) { } 0 0 0
Condition0%0/6
defined $start_x and $x < $start_x || $x >= $end_x
!ll&&!rl&&r
000
$x < $start_x or $x >= $end_x
l!l&&r!l&&!r
000
MC/DC0%0/3
defined $start_x and $x < $start_x || $x >= $end_x
defined $start_x $x < $start_x $x >= $end_x
Truth table0%0/4
A and B or C
A= defined $start_xB= $x < $start_xC= $x >= $end_x
ABCresult
0XX0
1000
11X1
1011
50 {
51 # skip
52 }
53 ▶ elsif($x >= 0 && $y >= 0)
Condition0%0/3
$x >= 0 and $y >= 0
!ll&&!rl&&r
000
MC/DC0%0/2
$x >= 0 and $y >= 0
$x >= 0 $y >= 0
Truth table0%0/3
A and B
A= $x >= 0B= $y >= 0
ABresult
0X0
100
111
54 {
55 # keep the characters that may be crossing in the array
56 # other characters are discarded
57 0 ▶ if(exists $cross_filler_chars->{$character})
Branch: 1 branch
BranchTrueFalseTotal
if (exists $cross_filler_chars->{$character}) { } 0 0 0
58 {
59 0 ▶ if(defined $lines[$y][$x])
Branch: 1 branch
BranchTrueFalseTotal
if (defined $lines[$y][$x]) { } 0 0 0
60 {
61 0 push @{$lines[$y][$x]}, $character ;
62
63 0 push @cross_point_index, [$y, $x] ;
64 }
65 else
66 {
67 0 $lines[$y][$x] = [$character] ;
68 }
69
70 }
71 else
72 {
73 0 delete $lines[$y][$x] ;
74 }
75 }
76
77 0 $character_index += unicode_length($character);
78 }
79 }
80 }
81 }
82  
83 0 @cross_point_index = grep { defined $lines[$_->[0]][$_->[1]][1] } @cross_point_index ;
84  
85 0 return(\@lines, \@cross_point_index) ;
86 }
87  
88 #-----------------------------------------------------------------------------
89 # ascii: + X . '
90 # unicode: ┼ ┤ ├ ┬ ┴ ╭ ╮ ╯ ╰ ╳ ... ...
91  
92 4 ▶use Readonly ;
Subroutine BEGIN: called CC=1 SCAR=0.0
93 4 Readonly my $CHARACTER => 0 ;
94 4 Readonly my $FUNCTION => 1 ;
95 4 Readonly my $CHAR_CATEGORY_INDEXS => 2 ;
96  
97 {
98  
99 4 my ($undef_char, %normal_char_cache, %diagonal_char_cache) = ('w') ;
100  
101 4 my %all_cross_chars = map {$_, 1}
102 (
103 '-', '|', '.', '\'', '\\', '/', '+', '╱', '╲', '╳',
104 '─', '│', '┼', '┤', '├', '┬', '┴', '╭', '╮', '╯', '╰',
105 '━', '┃', '╋', '┫', '┣', '┳', '┻', '┏', '┓', '┛', '┗',
106 '═', '║', '╬', '╣', '╠', '╦', '╩', '╔', '╗', '╝', '╚',
107 '╫', '╪', '╨', '╧', '╥', '╤', '╢', '╡', '╟', '╞', '╜',
108 '╛', '╙', '╘', '╖', '╕', '╓', '╒', '<', '>', '^', 'v',
109 '┍', '┎', '┑', '┒', '┕', '┖', '┙', '┚',
110 '┝', '┞', '┟', '┠', '┡', '┢',
111 '┥', '┦', '┧', '┨', '┩', '┪',
112 '┭', '┮', '┯', '┰', '┱', '┲',
113 '┵', '┶', '┷', '┸', '┹', '┺',
114 '┽', '┾', '┿', '╀', '╁', '╂', '╃',
115 '╄', '╅', '╆', '╇', '╈', '╉', '╊',
116 ) ;
117  
118 4 my %diagonal_cross_chars = map {$_, 1} ('\\', '/', '╱', '╲', '╳') ;
119  
120 4 my %unicode_left_thin_chars = map {$_, 1} ('─', '┼', '├', '┬', '┴', '╭', '╰', '╫', '╨', '╥', '╟', '╙', '╓', '┎', '┖', '┞', '┟', '┠', '┭', '┰', '┱', '┵', '┸', '┹', '┽', '╀', '╁', '╂', '╃', '╅', '╉') ;
121 4 my %unicode_right_thin_chars = map {$_, 1} ('─', '┼', '┤', '┬', '┴', '╮', '╯', '╫', '╨', '╥', '╢', '╜', '╖', '┒', '┚', '┦', '┧', '┨', '┮', '┰', '┲', '┶', '┸', '┺', '┾', '╀', '╁', '╂', '╄', '╆', '╊') ;
122 4 my %unicode_up_thin_chars = map {$_, 1} ('│', '┼', '┤', '├', '┬', '╭', '╮', '╪', '╤', '╡', '╞', '╕', '╒', '┍', '┑', '┝', '┞', '┡', '┥', '┦', '┩', '┭', '┮', '┯', '┽', '┾', '┿', '╀', '╃', '╄', '╇') ;
123 4 my %unicode_down_thin_chars = map {$_, 1} ('│', '┼', '┤', '├', '┴', '╯', '╰', '╪', '╧', '╡', '╞', '╛', '╘', '┕', '┙', '┝', '┟', '┢', '┥', '┧', '┪', '┵', '┶', '┷', '┽', '┾', '┿', '╁', '╅', '╆', '╈') ;
124  
125 4 my %unicode_left_double_chars = map {$_, 1} ('═', '╬', '╠', '╦', '╩', '╔', '╚', '╪', '╧', '╤', '╞', '╘', '╒') ;
126 4 my %unicode_right_double_chars = map {$_, 1} ('═', '╬', '╣', '╦', '╩', '╗', '╝', '╪', '╧', '╤', '╡', '╛', '╕') ;
127 4 my %unicode_up_double_chars = map {$_, 1} ('║', '╬', '╣', '╠', '╦', '╔', '╗', '╫', '╥', '╢', '╟', '╖', '╓') ;
128 4 my %unicode_down_double_chars = map {$_, 1} ('║', '╬', '╣', '╠', '╩', '╝', '╚', '╫', '╨', '╢', '╟', '╜', '╙') ;
129  
130 4 my %unicode_left_bold_chars = map {$_, 1} ('━', '╋', '┣', '┳', '┻', '┏', '┗', '┍', '┕', '┝', '┡', '┢', '┮', '┯', '┲', '┶', '┷', '┺', '┾', '┿', '╄', '╆', '╇', '╈', '╊') ;
131 4 my %unicode_right_bold_chars = map {$_, 1} ('━', '╋', '┫', '┳', '┻', '┓', '┛', '┑', '┙', '┥', '┩', '┪', '┭', '┯', '┱', '┵', '┷', '┹', '┽', '┿', '╃', '╅', '╇', '╈', '╉') ;
132 4 my %unicode_up_bold_chars = map {$_, 1} ('┃', '╋', '┫', '┣', '┳', '┏', '┓', '┎', '┒', '┟', '┠', '┢', '┧', '┨', '┪', '┰', '┱', '┲', '╁', '╂', '╅', '╆', '╈', '╉', '╊') ;
133 4 my %unicode_down_bold_chars = map {$_, 1} ('┃', '╋', '┫', '┣', '┻', '┛', '┗', '┖', '┚', '┞', '┠', '┡', '┦', '┨', '┩', '┸', '┹', '┺', '╀', '╂', '╃', '╄', '╇', '╉', '╊') ;
134  
135 4 my @unicode_cross_chars = (
136 {%unicode_left_thin_chars} , {%unicode_left_double_chars} , {%unicode_left_bold_chars} ,
137 {%unicode_right_thin_chars} , {%unicode_right_double_chars} , {%unicode_right_bold_chars} ,
138 {%unicode_up_thin_chars} , {%unicode_up_double_chars} , {%unicode_up_bold_chars} ,
139 {%unicode_down_thin_chars} , {%unicode_down_double_chars} , {%unicode_down_bold_chars}
140 );
141  
142 # The index here has a one-to-one correspondence with the array unicode_cross_chars.
143 4 my $left_thin_index = 0;
144 4 my $left_double_index = 1;
145 4 my $left_bold_index = 2;
146 4 my $right_thin_index = 3;
147 4 my $right_double_index = 4;
148 4 my $right_bold_index = 5;
149 4 my $up_thin_index = 6;
150 4 my $up_double_index = 7;
151 4 my $up_bold_index = 8;
152 4 my $down_thin_index = 9;
153 4 my $down_double_index = 10;
154 4 my $down_bold_index = 11;
155  
156 4 my %left_index_map = map {$_ , 1} ($left_thin_index , $left_double_index , $left_bold_index) ;
157 4 my %right_index_map = map {$_ , 1} ($right_thin_index , $right_double_index , $right_bold_index) ;
158 4 my %up_index_map = map {$_ , 1} ($up_thin_index , $up_double_index , $up_bold_index) ;
159 4 my %down_index_map = map {$_ , 1} ($down_thin_index , $down_double_index , $down_bold_index) ;
160  
161 4 my @normal_char_func = (
162 ['+', \&scene_cross, ],
163 ['.', \&scene_dot, ],
164 ['\'',\&scene_apostrophe, ],
165
166 # Arranging them in order can reduce logical judgment. Because calculations are done sequentially
167 # 1. First are cross,
168 # 2. then are corner missing
169 # 3. and finally are two corners missing.
170 # Therefore, the order of functions in the array cannot be disrupted
171
172 # cross functios
173 ['┽' , \&scene_unicode , [$left_bold_index , $right_thin_index , $up_thin_index , $down_thin_index ]],
174 ['┾' , \&scene_unicode , [$left_thin_index , $right_bold_index , $up_thin_index , $down_thin_index ]],
175 ['┿' , \&scene_unicode , [$left_bold_index , $right_bold_index , $up_thin_index , $down_thin_index ]],
176 ['╀' , \&scene_unicode , [$left_thin_index , $right_thin_index , $up_bold_index , $down_thin_index ]],
177 ['╁' , \&scene_unicode , [$left_thin_index , $right_thin_index , $up_thin_index , $down_bold_index ]],
178 ['╂' , \&scene_unicode , [$left_thin_index , $right_thin_index , $up_bold_index , $down_bold_index ]],
179 ['╃' , \&scene_unicode , [$left_bold_index , $right_thin_index , $up_bold_index , $down_thin_index ]],
180 ['╄' , \&scene_unicode , [$left_thin_index , $right_bold_index , $up_bold_index , $down_thin_index ]],
181 ['╅' , \&scene_unicode , [$left_bold_index , $right_thin_index , $up_thin_index , $down_bold_index ]],
182 ['╆' , \&scene_unicode , [$left_thin_index , $right_bold_index , $up_thin_index , $down_bold_index ]],
183 ['╇' , \&scene_unicode , [$left_bold_index , $right_bold_index , $up_bold_index , $down_thin_index ]],
184 ['╈' , \&scene_unicode , [$left_bold_index , $right_bold_index , $up_thin_index , $down_bold_index ]],
185 ['╉' , \&scene_unicode , [$left_bold_index , $right_thin_index , $up_bold_index , $down_bold_index ]],
186 ['╊' , \&scene_unicode , [$left_thin_index , $right_bold_index , $up_bold_index , $down_bold_index ]],
187 ['╫' , \&scene_unicode , [$left_thin_index , $right_thin_index , $up_double_index , $down_double_index ]],
188 ['╪' , \&scene_unicode , [$left_double_index , $right_double_index , $up_thin_index , $down_thin_index ]],
189 ['┼' , \&scene_unicode , [$left_thin_index , $right_thin_index , $up_thin_index , $down_thin_index ]],
190 ['╋' , \&scene_unicode , [$left_bold_index , $right_bold_index , $up_bold_index , $down_bold_index ]],
191 ['╬' , \&scene_unicode , [$left_double_index , $right_double_index , $up_double_index , $down_double_index ]],
192  
193 # one corner missing functios
194 ['┵' , \&scene_unicode , [$left_bold_index , $right_thin_index , $up_thin_index ]],
195 ['┶' , \&scene_unicode , [$left_thin_index , $right_bold_index , $up_thin_index ]],
196 ['┷' , \&scene_unicode , [$left_bold_index , $right_bold_index , $up_thin_index ]],
197 ['┸' , \&scene_unicode , [$left_thin_index , $right_thin_index , $up_bold_index ]],
198 ['┹' , \&scene_unicode , [$left_bold_index , $right_thin_index , $up_bold_index ]],
199 ['┺' , \&scene_unicode , [$left_thin_index , $right_bold_index , $up_bold_index ]],
200 ['┭' , \&scene_unicode , [$left_bold_index , $right_thin_index , $down_thin_index ]],
201 ['┮' , \&scene_unicode , [$left_thin_index , $right_bold_index , $down_thin_index ]],
202 ['┯' , \&scene_unicode , [$left_bold_index , $right_bold_index , $down_thin_index ]],
203 ['┰' , \&scene_unicode , [$left_thin_index , $right_thin_index , $down_bold_index ]],
204 ['┱' , \&scene_unicode , [$left_bold_index , $right_thin_index , $down_bold_index ]],
205 ['┲' , \&scene_unicode , [$left_thin_index , $right_bold_index , $down_bold_index ]],
206 ['┥' , \&scene_unicode , [$left_bold_index , $up_thin_index , $down_thin_index ]],
207 ['┦' , \&scene_unicode , [$left_thin_index , $up_bold_index , $down_thin_index ]],
208 ['┧' , \&scene_unicode , [$left_thin_index , $up_thin_index , $down_bold_index ]],
209 ['┨' , \&scene_unicode , [$left_thin_index , $up_bold_index , $down_bold_index ]],
210 ['┩' , \&scene_unicode , [$left_bold_index , $up_bold_index , $down_thin_index ]],
211 ['┪' , \&scene_unicode , [$left_bold_index , $up_thin_index , $down_bold_index ]],
212 ['┝' , \&scene_unicode , [$right_bold_index , $up_thin_index , $down_thin_index ]],
213 ['┞' , \&scene_unicode , [$right_thin_index , $up_bold_index , $down_thin_index ]],
214 ['┟' , \&scene_unicode , [$right_thin_index , $up_thin_index , $down_bold_index ]],
215 ['┠' , \&scene_unicode , [$right_thin_index , $up_bold_index , $down_bold_index ]],
216 ['┡' , \&scene_unicode , [$right_bold_index , $up_bold_index , $down_thin_index ]],
217 ['┢' , \&scene_unicode , [$right_bold_index , $up_thin_index , $down_bold_index ]],
218 ['╨' , \&scene_unicode , [$left_thin_index , $right_thin_index , $up_double_index ]],
219 ['╧' , \&scene_unicode , [$left_double_index , $right_double_index , $up_thin_index ]],
220 ['╥' , \&scene_unicode , [$left_thin_index , $right_thin_index , $down_double_index ]],
221 ['╤' , \&scene_unicode , [$left_double_index , $right_double_index , $down_thin_index ]],
222 ['╢' , \&scene_unicode , [$left_thin_index , $up_double_index , $down_double_index ]],
223 ['╡' , \&scene_unicode , [$left_double_index , $up_thin_index , $down_thin_index ]],
224 ['╟' , \&scene_unicode , [$right_thin_index , $up_double_index , $down_double_index ]],
225 ['╞' , \&scene_unicode , [$right_double_index , $up_thin_index , $down_thin_index ]],
226 ['┤' , \&scene_unicode , [$left_thin_index , $up_thin_index , $down_thin_index ]],
227 ['├' , \&scene_unicode , [$right_thin_index , $up_thin_index , $down_thin_index ]],
228 ['┬' , \&scene_unicode , [$left_thin_index , $right_thin_index , $down_thin_index ]],
229 ['┴' , \&scene_unicode , [$left_thin_index , $right_thin_index , $up_thin_index ]],
230 ['┫' , \&scene_unicode , [$left_bold_index , $up_bold_index , $down_bold_index ]],
231 ['┣' , \&scene_unicode , [$right_bold_index , $up_bold_index , $down_bold_index ]],
232 ['┳' , \&scene_unicode , [$left_bold_index , $right_bold_index , $down_bold_index ]],
233 ['┻' , \&scene_unicode , [$left_bold_index , $right_bold_index , $up_bold_index ]],
234 ['╣' , \&scene_unicode , [$left_double_index , $up_double_index , $down_double_index ]],
235 ['╠' , \&scene_unicode , [$right_double_index , $up_double_index , $down_double_index ]],
236 ['╦' , \&scene_unicode , [$left_double_index , $right_double_index , $down_double_index ]],
237 ['╩' , \&scene_unicode , [$left_double_index , $right_double_index , $up_double_index ]],
238  
239 # two corners missing
240 ['╜' , \&scene_unicode , [$left_thin_index , $up_double_index ]],
241 ['╛' , \&scene_unicode , [$left_double_index , $up_thin_index ]],
242 ['╙' , \&scene_unicode , [$right_thin_index , $up_double_index ]],
243 ['╘' , \&scene_unicode , [$right_double_index , $up_thin_index ]],
244 ['╖' , \&scene_unicode , [$left_thin_index , $down_double_index ]],
245 ['╕' , \&scene_unicode , [$left_double_index , $down_thin_index ]],
246 ['╓' , \&scene_unicode , [$right_thin_index , $down_double_index ]],
247 ['╒' , \&scene_unicode , [$right_double_index , $down_thin_index ]],
248 ['┍' , \&scene_unicode , [$right_bold_index , $down_thin_index ]],
249 ['┎' , \&scene_unicode , [$right_thin_index , $down_bold_index ]],
250 ['┑' , \&scene_unicode , [$left_bold_index , $down_thin_index ]],
251 ['┒' , \&scene_unicode , [$left_thin_index , $down_bold_index ]],
252 ['┕' , \&scene_unicode , [$right_bold_index , $up_thin_index ]],
253 ['┖' , \&scene_unicode , [$right_thin_index , $up_bold_index ]],
254 ['┙' , \&scene_unicode , [$left_bold_index , $up_thin_index ]],
255 ['┚' , \&scene_unicode , [$left_thin_index , $up_bold_index ]],
256 ['╭' , \&scene_unicode , [$right_thin_index , $down_thin_index ]],
257 ['╮' , \&scene_unicode , [$left_thin_index , $down_thin_index ]],
258 ['╯' , \&scene_unicode , [$left_thin_index , $up_thin_index ]],
259 ['╰' , \&scene_unicode , [$right_thin_index , $up_thin_index ]],
260 ['┏' , \&scene_unicode , [$right_bold_index , $down_bold_index ]],
261 ['┓' , \&scene_unicode , [$left_bold_index , $down_bold_index ]],
262 ['┛' , \&scene_unicode , [$left_bold_index , $up_bold_index ]],
263 ['┗' , \&scene_unicode , [$right_bold_index , $up_bold_index ]],
264 ['╔' , \&scene_unicode , [$right_double_index , $down_double_index ]],
265 ['╗' , \&scene_unicode , [$left_double_index , $down_double_index ]],
266 ['╝' , \&scene_unicode , [$left_double_index , $up_double_index ]],
267 ['╚' , \&scene_unicode , [$right_double_index , $up_double_index ]],
268 ) ;
269  
270 4 my @diagonal_char_func = (
271 ['X', \&scene_x],
272 ['╳', \&scene_unicode_x],
273 ) ;
274  
275  
276 sub get_cross_mode_overlays
277 0 ▶{
Subroutine get_cross_mode_overlays: not called CC=19 SCAR=59.4
Pod undocumented
278 0 my ($asciio, $start_x, $end_x, $start_y, $end_y) = @_;
279  
280 0 my ($ascii_array, $crossings) = get_ascii_array_and_crossings($asciio, \%all_cross_chars, $start_x, $end_x, $start_y, $end_y);
281 0 my @ascii_array = @{$ascii_array} ;
282  
283 0 my @overlays ;
284  
285 0 for(@{$crossings})
286 {
287 0 my ($row, $col) = @{$_} ;
288
289 0 my ($up, $down, $left, $right) =
290 ($ascii_array[$row-1][$col], $ascii_array[$row+1][$col], $ascii_array[$row][$col-1], $ascii_array[$row][$col+1]);
291
292 0 ▶ my $normal_key = ((defined $up) ? join('o', @{$up}) : $undef_char) . '_'
Branch: 1 branch
BranchTrueFalseTotal
defined $down ? : 0 0 0
293 0 ▶ . ((defined $down) ? join('o', @{$down}) : $undef_char) . '_'
Branch: 1 branch
BranchTrueFalseTotal
defined $left ? : 0 0 0
294 0 ▶ . ((defined $left) ? join('o', @{$left}) : $undef_char) . '_'
Branch: 1 branch
BranchTrueFalseTotal
defined $right ? : 0 0 0
295 0 ▶ . ((defined $right) ? join('o', @{$right}) : $undef_char) ;
Branch: 1 branch
BranchTrueFalseTotal
defined $up ? : 0 0 0
296
297 0 ▶ unless(exists $normal_char_cache{$normal_key})
Branch: 1 branch
BranchTrueFalseTotal
unless (exists $normal_char_cache{$normal_key}) 0 0 0
298 {
299 0 ▶ my $scene_func = first { $_->[$FUNCTION]($up, $down, $left, $right, $_->[$CHAR_CATEGORY_INDEXS]) } @normal_char_func;
Subroutine __ANON__: not called CC=1 SCAR=6.9
300 0 ▶ $normal_char_cache{$normal_key} = ($scene_func) ? $scene_func->[$CHARACTER] : '';
Branch: 1 branch
BranchTrueFalseTotal
$scene_func ? : 0 0 0
301 }
302
303 0 ▶ if($normal_char_cache{$normal_key})
Branch: 1 branch
BranchTrueFalseTotal
if ($normal_char_cache{$normal_key}) 0 0 0
304 {
305 0 ▶ if($normal_char_cache{$normal_key} ne $ascii_array[$row][$col][-1])
Branch: 1 branch
BranchTrueFalseTotal
if ($normal_char_cache{$normal_key} ne $ascii_array[$row][$col][-1]) 0 0 0
306 {
307 0 push @overlays, [$col, $row, $normal_char_cache{$normal_key}];
308 }
309  
310 0 next;
311 }
312
313 0 ▶ next unless exists $diagonal_cross_chars{$ascii_array[$row][$col][-1]} ;
Branch: 1 branch
BranchTrueFalseTotal
unless exists $diagonal_cross_chars{$ascii_array[$row][$col][-1]} 0 0 0
314
315 0 my ($char_45, $char_135, $char_225, $char_315) =
316 ($ascii_array[$row-1][$col+1], $ascii_array[$row+1][$col+1], $ascii_array[$row+1][$col-1], $ascii_array[$row-1][$col-1]);
317
318 0 ▶ my $diagonal_key = ((defined $char_45) ? join('o', @{$char_45}) : $undef_char) . '_'
Branch: 1 branch
BranchTrueFalseTotal
defined $char_135 ? : 0 0 0
319 0 ▶ . ((defined $char_135) ? join('o', @{$char_135}) : $undef_char) . '_'
Branch: 1 branch
BranchTrueFalseTotal
defined $char_225 ? : 0 0 0
320 0 ▶ . ((defined $char_225) ? join('o', @{$char_225}) : $undef_char) . '_'
Branch: 1 branch
BranchTrueFalseTotal
defined $char_315 ? : 0 0 0
321 0 ▶ . ((defined $char_315) ? join('o', @{$char_315}) : $undef_char) ;
Branch: 1 branch
BranchTrueFalseTotal
defined $char_45 ? : 0 0 0
322
323 0 ▶ unless(exists $diagonal_char_cache{$diagonal_key})
Branch: 1 branch
BranchTrueFalseTotal
unless (exists $diagonal_char_cache{$diagonal_key}) 0 0 0
324 {
325 0 ▶ my $scene_func = first { $_->[$FUNCTION]($char_45, $char_135, $char_225, $char_315) } @diagonal_char_func;
Subroutine __ANON__: not called CC=1 SCAR=6.9
326 0 ▶ $diagonal_char_cache{$diagonal_key} = ($scene_func) ? $scene_func->[$CHARACTER] : '';
Branch: 1 branch
BranchTrueFalseTotal
$scene_func ? : 0 0 0
327 }
328
329 0 ▶ if($diagonal_char_cache{$diagonal_key} && ($diagonal_char_cache{$diagonal_key} ne $ascii_array[$row][$col][-1]))
Branch: 1 branch
BranchTrueFalseTotal
if ($diagonal_char_cache{$diagonal_key} and $diagonal_char_cache{$diagonal_key} ne $ascii_array[$row][$col][-1]) 0 0 0
Condition0%0/3
$diagonal_char_cache{$diagonal_key} and $diagonal_char_cache{$diagonal_key} ne $ascii_array[$row][$col][-1]
!ll&&!rl&&r
000
MC/DC0%0/2
$diagonal_char_cache{$diagonal_key} and $diagonal_char_cache{$diagonal_key} ne $ascii_array[$row][$col][-1]
$diagonal_char_cache{$diagonal_key} $diagonal_char_cache{$diagonal_key} ne $ascii_array[$row][$col][-1]
Truth table0%0/3
A and B
A= $diagonal_char_cache{$diagonal_key}B= $diagonal_char_cache{$diagonal_key} ne $ascii_array[$row][$col][-1]
ABresult
0X0
100
111
330 {
331 0 push @overlays, [$col, $row, $diagonal_char_cache{$diagonal_key}];
332 }
333  
334 }
335  
336 0 return @overlays ;
337 }
338  
339 #-----------------------------------------------------------------------------
340 # +
341 sub scene_cross
342 0 ▶{
Subroutine scene_cross: not called CC=24 SCAR=64.0
Pod undocumented
343 0 my ($up, $down, $left, $right, $char_category_indexs) = @_;
344  
345 0 ▶return 0 unless defined $up && defined $down && defined $left && defined $right ;
Branch: 1 branch
BranchTrueFalseTotal
unless defined $up and defined $down and defined $left and defined $right 0 0 0
Condition0%0/9
defined $up and defined $down and defined $left and defined $right
!ll&&!rl&&r
000
defined $up and defined $down and defined $left
!ll&&!rl&&r
000
defined $up and defined $down
!ll&&!rl&&r
000
MC/DC0%0/4
defined $up and defined $down and defined $left and defined $right
defined $up defined $down defined $left defined $right
Truth table0%0/5
A and B and C and D
A= defined $upB= defined $downC= defined $leftD= defined $right
ABCDresult
0XXX0
10XX0
110X0
11100
11111
346  
347 0 ▶return ((any {$_ eq '|'} @{$up}) || (any {$_ eq '.'} @{$up}) || (any {$_ eq '\''} @{$up}) || (any {$_ eq '+'} @{$up}) || (any {$_ eq '^'} @{$up}))
Subroutine __ANON__: not called CC=1 SCAR=6.9
Subroutine __ANON__: not called CC=1 SCAR=6.9
Subroutine __ANON__: not called CC=1 SCAR=6.9
Subroutine __ANON__: not called CC=1 SCAR=6.9
Subroutine __ANON__: not called CC=1 SCAR=6.9
Condition0%0/12
&any(sub { $_ eq "|"; } , @{$down;}) or &any(sub { $_ eq "."; } , @{$down;}) or &any(sub { $_ eq "'"; } , @{$down;}) or &any(sub { $_ eq "+"; } , @{$down;}) or &any(sub { $_ eq "v"; } , @{$down;})
l!l&&r!l&&!r
000
&any(sub { $_ eq "|"; } , @{$down;}) or &any(sub { $_ eq "."; } , @{$down;}) or &any(sub { $_ eq "'"; } , @{$down;}) or &any(sub { $_ eq "+"; } , @{$down;})
l!l&&r!l&&!r
000
&any(sub { $_ eq "|"; } , @{$down;}) or &any(sub { $_ eq "."; } , @{$down;}) or &any(sub { $_ eq "'"; } , @{$down;})
l!l&&r!l&&!r
000
&any(sub { $_ eq "|"; } , @{$down;}) or &any(sub { $_ eq "."; } , @{$down;})
l!l&&r!l&&!r
000
MC/DC0%0/5
&any(sub { $_ eq "|"; } , @{$down;}) or &any(sub { $_ eq "."; } , @{$down;}) or &any(sub { $_ eq "'"; } , @{$down;}) or &any(sub { $_ eq "+"; } , @{$down;}) or &any(sub { $_ eq "v"; } , @{$down;})
&any(sub { $_ eq "|"; } , @{$down;}) &any(sub { $_ eq "."; } , @{$down;}) &any(sub { $_ eq "'"; } , @{$down;}) &any(sub { $_ eq "+"; } , @{$down;}) &any(sub { $_ eq "v"; } , @{$down;})
Truth table0%0/6
A or B or C or D or E
A= &any(sub { $_ eq "|"; } , @{$down;})B= &any(sub { $_ eq "."; } , @{$down;})C= &any(sub { $_ eq "'"; } , @{$down;})D= &any(sub { $_ eq "+"; } , @{$down;})E= &any(sub { $_ eq "v"; } , @{$down;})
ABCDEresult
1XXXX1
01XXX1
001XX1
0001X1
000011
000000
348 0 ▶ && ((any {$_ eq '|'} @{$down}) || (any {$_ eq '.'} @{$down}) || (any {$_ eq '\''} @{$down}) || (any {$_ eq '+'} @{$down}) || (any {$_ eq 'v'} @{$down}))
Subroutine __ANON__: not called CC=1 SCAR=6.9
Subroutine __ANON__: not called CC=1 SCAR=6.9
Subroutine __ANON__: not called CC=1 SCAR=6.9
Subroutine __ANON__: not called CC=1 SCAR=6.9
Subroutine __ANON__: not called CC=1 SCAR=6.9
Condition0%0/12
&any(sub { $_ eq "-"; } , @{$left;}) or &any(sub { $_ eq "."; } , @{$left;}) or &any(sub { $_ eq "'"; } , @{$left;}) or &any(sub { $_ eq "+"; } , @{$left;}) or &any(sub { $_ eq "<"; } , @{$left;})
l!l&&r!l&&!r
000
&any(sub { $_ eq "-"; } , @{$left;}) or &any(sub { $_ eq "."; } , @{$left;}) or &any(sub { $_ eq "'"; } , @{$left;}) or &any(sub { $_ eq "+"; } , @{$left;})
l!l&&r!l&&!r
000
&any(sub { $_ eq "-"; } , @{$left;}) or &any(sub { $_ eq "."; } , @{$left;}) or &any(sub { $_ eq "'"; } , @{$left;})
l!l&&r!l&&!r
000
&any(sub { $_ eq "-"; } , @{$left;}) or &any(sub { $_ eq "."; } , @{$left;})
l!l&&r!l&&!r
000
MC/DC0%0/5
&any(sub { $_ eq "-"; } , @{$left;}) or &any(sub { $_ eq "."; } , @{$left;}) or &any(sub { $_ eq "'"; } , @{$left;}) or &any(sub { $_ eq "+"; } , @{$left;}) or &any(sub { $_ eq "<"; } , @{$left;})
&any(sub { $_ eq "-"; } , @{$left;}) &any(sub { $_ eq "."; } , @{$left;}) &any(sub { $_ eq "'"; } , @{$left;}) &any(sub { $_ eq "+"; } , @{$left;}) &any(sub { $_ eq "<"; } , @{$left;})
Truth table0%0/6
A or B or C or D or E
A= &any(sub { $_ eq "-"; } , @{$left;})B= &any(sub { $_ eq "."; } , @{$left;})C= &any(sub { $_ eq "'"; } , @{$left;})D= &any(sub { $_ eq "+"; } , @{$left;})E= &any(sub { $_ eq "<"; } , @{$left;})
ABCDEresult
1XXXX1
01XXX1
001XX1
0001X1
000011
000000
349 0 ▶ && ((any {$_ eq '-'} @{$left}) || (any {$_ eq '.'} @{$left}) || (any {$_ eq '\''} @{$left}) || (any {$_ eq '+'} @{$left}) || (any {$_ eq '<'} @{$left}))
Subroutine __ANON__: not called CC=1 SCAR=6.9
Subroutine __ANON__: not called CC=1 SCAR=6.9
Subroutine __ANON__: not called CC=1 SCAR=6.9
Subroutine __ANON__: not called CC=1 SCAR=6.9
Subroutine __ANON__: not called CC=1 SCAR=6.9
Condition0%0/12
&any(sub { $_ eq "-"; } , @{$right;}) or &any(sub { $_ eq "."; } , @{$right;}) or &any(sub { $_ eq "'"; } , @{$right;}) or &any(sub { $_ eq "+"; } , @{$right;}) or &any(sub { $_ eq ">"; } , @{$right;})
l!l&&r!l&&!r
000
&any(sub { $_ eq "-"; } , @{$right;}) or &any(sub { $_ eq "."; } , @{$right;}) or &any(sub { $_ eq "'"; } , @{$right;}) or &any(sub { $_ eq "+"; } , @{$right;})
l!l&&r!l&&!r
000
&any(sub { $_ eq "-"; } , @{$right;}) or &any(sub { $_ eq "."; } , @{$right;}) or &any(sub { $_ eq "'"; } , @{$right;})
l!l&&r!l&&!r
000
&any(sub { $_ eq "-"; } , @{$right;}) or &any(sub { $_ eq "."; } , @{$right;})
l!l&&r!l&&!r
000
MC/DC0%0/5
&any(sub { $_ eq "-"; } , @{$right;}) or &any(sub { $_ eq "."; } , @{$right;}) or &any(sub { $_ eq "'"; } , @{$right;}) or &any(sub { $_ eq "+"; } , @{$right;}) or &any(sub { $_ eq ">"; } , @{$right;})
&any(sub { $_ eq "-"; } , @{$right;}) &any(sub { $_ eq "."; } , @{$right;}) &any(sub { $_ eq "'"; } , @{$right;}) &any(sub { $_ eq "+"; } , @{$right;}) &any(sub { $_ eq ">"; } , @{$right;})
Truth table0%0/6
A or B or C or D or E
A= &any(sub { $_ eq "-"; } , @{$right;})B= &any(sub { $_ eq "."; } , @{$right;})C= &any(sub { $_ eq "'"; } , @{$right;})D= &any(sub { $_ eq "+"; } , @{$right;})E= &any(sub { $_ eq ">"; } , @{$right;})
ABCDEresult
1XXXX1
01XXX1
001XX1
0001X1
000011
000000
350 0 ▶ && ((any {$_ eq '-'} @{$right}) || (any {$_ eq '.'} @{$right}) || (any {$_ eq '\''} @{$right}) || (any {$_ eq '+'} @{$right}) || (any {$_ eq '>'} @{$right})) ;
Subroutine __ANON__: not called CC=1 SCAR=6.9
Subroutine __ANON__: not called CC=1 SCAR=6.9
Subroutine __ANON__: not called CC=1 SCAR=6.9
Subroutine __ANON__: not called CC=1 SCAR=6.9
Subroutine __ANON__: not called CC=1 SCAR=6.9
Condition0%0/21
(&any(sub { $_ eq '|'; } , @{$up;}) || &any(sub { $_ eq '.'; } , @{$up;}) || &any(sub { $_ eq q[']; } , @{$up;}) || &any(sub { $_ eq '+'; } , @{$up;}) || &any(sub { $_ eq '^'; } , @{$up;})) && (&any(sub { $_ eq '|'; } , @{$down;}) || &any(sub { $_ eq '.'; } , @{$down;}) || &any(sub { $_ eq q[']; } , @{$down;}) || &any(sub { $_ eq '+'; } , @{$down;}) || &any(sub { $_ eq 'v'; } , @{$down;})) && (&any(sub { $_ eq '-'; } , @{$left;}) || &any(sub { $_ eq '.'; } , @{$left;}) || &any(sub { $_ eq q[']; } , @{$left;}) || &any(sub { $_ eq '+'; } , @{$left;}) || &any(sub { $_ eq '<'; } , @{$left;})) && (&any(sub { $_ eq '-'; } , @{$right;}) || &any(sub { $_ eq '.'; } , @{$right;}) || &any(sub { $_ eq q[']; } , @{$right;}) || &any(sub { $_ eq '+'; } , @{$right;}) || &any(sub { $_ eq '>'; } , @{$right;}))
!ll&&!rl&&r
000
&any(sub { $_ eq "|"; } , @{$up;}) || &any(sub { $_ eq "."; } , @{$up;}) || &any(sub { $_ eq "'"; } , @{$up;}) || &any(sub { $_ eq "+"; } , @{$up;}) || &any(sub { $_ eq "^"; } , @{$up;}) and &any(sub { $_ eq "|"; } , @{$down;}) || &any(sub { $_ eq "."; } , @{$down;}) || &any(sub { $_ eq "'"; } , @{$down;}) || &any(sub { $_ eq "+"; } , @{$down;}) || &any(sub { $_ eq "v"; } , @{$down;}) and &any(sub { $_ eq "-"; } , @{$left;}) || &any(sub { $_ eq "."; } , @{$left;}) || &any(sub { $_ eq "'"; } , @{$left;}) || &any(sub { $_ eq "+"; } , @{$left;}) || &any(sub { $_ eq "<"; } , @{$left;})
!ll&&!rl&&r
000
&any(sub { $_ eq "|"; } , @{$up;}) || &any(sub { $_ eq "."; } , @{$up;}) || &any(sub { $_ eq "'"; } , @{$up;}) || &any(sub { $_ eq "+"; } , @{$up;}) || &any(sub { $_ eq "^"; } , @{$up;}) and &any(sub { $_ eq "|"; } , @{$down;}) || &any(sub { $_ eq "."; } , @{$down;}) || &any(sub { $_ eq "'"; } , @{$down;}) || &any(sub { $_ eq "+"; } , @{$down;}) || &any(sub { $_ eq "v"; } , @{$down;})
!ll&&!rl&&r
000
&any(sub { $_ eq "|"; } , @{$up;}) or &any(sub { $_ eq "."; } , @{$up;}) or &any(sub { $_ eq "'"; } , @{$up;}) or &any(sub { $_ eq "+"; } , @{$up;}) or &any(sub { $_ eq "^"; } , @{$up;})
l!l&&r!l&&!r
000
&any(sub { $_ eq "|"; } , @{$up;}) or &any(sub { $_ eq "."; } , @{$up;}) or &any(sub { $_ eq "'"; } , @{$up;}) or &any(sub { $_ eq "+"; } , @{$up;})
l!l&&r!l&&!r
000
&any(sub { $_ eq "|"; } , @{$up;}) or &any(sub { $_ eq "."; } , @{$up;}) or &any(sub { $_ eq "'"; } , @{$up;})
l!l&&r!l&&!r
000
&any(sub { $_ eq "|"; } , @{$up;}) or &any(sub { $_ eq "."; } , @{$up;})
l!l&&r!l&&!r
000
MC/DC0%0/8
(&any(sub { $_ eq '|'; } , @{$up;}) || &any(sub { $_ eq '.'; } , @{$up;}) || &any(sub { $_ eq q[']; } , @{$up;}) || &any(sub { $_ eq '+'; } , @{$up;}) || &any(sub { $_ eq '^'; } , @{$up;})) && (&any(sub { $_ eq '|'; } , @{$down;}) || &any(sub { $_ eq '.'; } , @{$down;}) || &any(sub { $_ eq q[']; } , @{$down;}) || &any(sub { $_ eq '+'; } , @{$down;}) || &any(sub { $_ eq 'v'; } , @{$down;})) && (&any(sub { $_ eq '-'; } , @{$left;}) || &any(sub { $_ eq '.'; } , @{$left;}) || &any(sub { $_ eq q[']; } , @{$left;}) || &any(sub { $_ eq '+'; } , @{$left;}) || &any(sub { $_ eq '<'; } , @{$left;})) && (&any(sub { $_ eq '-'; } , @{$right;}) || &any(sub { $_ eq '.'; } , @{$right;}) || &any(sub { $_ eq q[']; } , @{$right;}) || &any(sub { $_ eq '+'; } , @{$right;}) || &any(sub { $_ eq '>'; } , @{$right;}))
&any(sub { $_ eq "|"; } , @{$up;}) &any(sub { $_ eq "."; } , @{$up;}) &any(sub { $_ eq "'"; } , @{$up;}) &any(sub { $_ eq "+"; } , @{$up;}) &any(sub { $_ eq "^"; } , @{$up;}) &any(sub { $_ eq "|"; } , @{$down;}) || &any(sub { $_ eq "."; } , @{$down;}) || &any(sub { $_ eq "'"; } , @{$down;}) || &any(sub { $_ eq "+"; } , @{$down;}) || &any(sub { $_ eq "v"; } , @{$down;}) &any(sub { $_ eq "-"; } , @{$left;}) || &any(sub { $_ eq "."; } , @{$left;}) || &any(sub { $_ eq "'"; } , @{$left;}) || &any(sub { $_ eq "+"; } , @{$left;}) || &any(sub { $_ eq "<"; } , @{$left;}) (&any(sub { $_ eq '-'; } , @{$right;}) || &any(sub { $_ eq '.'; } , @{$right;}) || &any(sub { $_ eq q[']; } , @{$right;}) || &any(sub { $_ eq '+'; } , @{$right;}) || &any(sub { $_ eq '>'; } , @{$right;}))
Truth table0%0/21
A or B or C or D or E and F and G && H
A= &any(sub { $_ eq "|"; } , @{$up;})B= &any(sub { $_ eq "."; } , @{$up;})C= &any(sub { $_ eq "'"; } , @{$up;})D= &any(sub { $_ eq "+"; } , @{$up;})E= &any(sub { $_ eq "^"; } , @{$up;})F= &any(sub { $_ eq "|"; } , @{$down;}) || &any(sub { $_ eq "."; } , @{$down;}) || &any(sub { $_ eq "'"; } , @{$down;}) || &any(sub { $_ eq "+"; } , @{$down;}) || &any(sub { $_ eq "v"; } , @{$down;})G= &any(sub { $_ eq "-"; } , @{$left;}) || &any(sub { $_ eq "."; } , @{$left;}) || &any(sub { $_ eq "'"; } , @{$left;}) || &any(sub { $_ eq "+"; } , @{$left;}) || &any(sub { $_ eq "<"; } , @{$left;})H= (&any(sub { $_ eq '-'; } , @{$right;}) || &any(sub { $_ eq '.'; } , @{$right;}) || &any(sub { $_ eq q[']; } , @{$right;}) || &any(sub { $_ eq '+'; } , @{$right;}) || &any(sub { $_ eq '>'; } , @{$right;}))
ABCDEFGHresult
00000XXX0
1XXXX0XX0
01XXX0XX0
001XX0XX0
0001X0XX0
000010XX0
1XXXX10X0
01XXX10X0
001XX10X0
0001X10X0
0000110X0
1XXXX1100
01XXX1100
001XX1100
0001X1100
000011100
1XXXX1111
01XXX1111
001XX1111
0001X1111
000011111
351 }
352  
353 #-----------------------------------------------------------------------------
354 # .
355 # | |
356 # ---. .--- ---.--- | |
357 # | | | ---. .---
358 # | | | | |
359 sub scene_dot
360 0 ▶{
Subroutine scene_dot: not called CC=16 SCAR=56.1
Pod undocumented
361 0 my ($up, $down, $left, $right, $char_category_indexs) = @_;
362  
363 0 ▶return 0 if defined $up && (any {$_ eq '|'} @{$up})
Subroutine __ANON__: not called CC=1 SCAR=6.9
364 0 ▶ && defined $down && (any {$_ eq '|'} @{$down})
Subroutine __ANON__: not called CC=1 SCAR=6.9
365 0 ▶ && defined $left && (any {$_ eq '-'} @{$left})
Subroutine __ANON__: not called CC=1 SCAR=6.9
366 0 ▶ && defined $right && (any {$_ eq '-'} @{$right}) ;
Subroutine __ANON__: not called CC=1 SCAR=6.9
Branch: 1 branch
BranchTrueFalseTotal
if defined $up and &any(sub { $_ eq "|"; } , @{$up;}) and defined $down and &any(sub { $_ eq "|"; } , @{$down;}) and defined $left and &any(sub { $_ eq "-"; } , @{$left;}) and defined $right and &any(sub { $_ eq "-"; } , @{$right;}) 0 0 0
Condition0%0/21
defined $up and &any(sub { $_ eq "|"; } , @{$up;}) and defined $down and &any(sub { $_ eq "|"; } , @{$down;}) and defined $left and &any(sub { $_ eq "-"; } , @{$left;}) and defined $right and &any(sub { $_ eq "-"; } , @{$right;})
!ll&&!rl&&r
000
defined $up and &any(sub { $_ eq "|"; } , @{$up;}) and defined $down and &any(sub { $_ eq "|"; } , @{$down;}) and defined $left and &any(sub { $_ eq "-"; } , @{$left;}) and defined $right
!ll&&!rl&&r
000
defined $up and &any(sub { $_ eq "|"; } , @{$up;}) and defined $down and &any(sub { $_ eq "|"; } , @{$down;}) and defined $left and &any(sub { $_ eq "-"; } , @{$left;})
!ll&&!rl&&r
000
defined $up and &any(sub { $_ eq "|"; } , @{$up;}) and defined $down and &any(sub { $_ eq "|"; } , @{$down;}) and defined $left
!ll&&!rl&&r
000
defined $up and &any(sub { $_ eq "|"; } , @{$up;}) and defined $down and &any(sub { $_ eq "|"; } , @{$down;})
!ll&&!rl&&r
000
defined $up and &any(sub { $_ eq "|"; } , @{$up;}) and defined $down
!ll&&!rl&&r
000
defined $up and &any(sub { $_ eq "|"; } , @{$up;})
!ll&&!rl&&r
000
MC/DC0%0/8
defined $up and &any(sub { $_ eq "|"; } , @{$up;}) and defined $down and &any(sub { $_ eq "|"; } , @{$down;}) and defined $left and &any(sub { $_ eq "-"; } , @{$left;}) and defined $right and &any(sub { $_ eq "-"; } , @{$right;})
defined $up &any(sub { $_ eq "|"; } , @{$up;}) defined $down &any(sub { $_ eq "|"; } , @{$down;}) defined $left &any(sub { $_ eq "-"; } , @{$left;}) defined $right &any(sub { $_ eq "-"; } , @{$right;})
Truth table0%0/9
A and B and C and D and E and F and G and H
A= defined $upB= &any(sub { $_ eq "|"; } , @{$up;})C= defined $downD= &any(sub { $_ eq "|"; } , @{$down;})E= defined $leftF= &any(sub { $_ eq "-"; } , @{$left;})G= defined $rightH= &any(sub { $_ eq "-"; } , @{$right;})
ABCDEFGHresult
0XXXXXXX0
10XXXXXX0
110XXXXX0
1110XXXX0
11110XXX0
111110XX0
1111110X0
111111100
111111111
367  
368 0 ▶return (((defined($left) && (any {$_ eq '-'} @{$left})) && (defined($down) && (any {$_ eq '|'} @{$down}))) ||
Subroutine __ANON__: not called CC=1 SCAR=6.9
Subroutine __ANON__: not called CC=1 SCAR=6.9
Condition0%0/9
defined $down and &any(sub { $_ eq "|"; } , @{$down;})
!ll&&!rl&&r
000
defined $right and &any(sub { $_ eq "-"; } , @{$right;}) and (defined $down and &any(sub { $_ eq "|"; } , @{$down;}))
!ll&&!rl&&r
000
defined $right and &any(sub { $_ eq "-"; } , @{$right;})
!ll&&!rl&&r
000
MC/DC0%0/2
defined $down and &any(sub { $_ eq "|"; } , @{$down;})
defined $down &any(sub { $_ eq "|"; } , @{$down;})
MC/DC0%0/3
defined $right and &any(sub { $_ eq "-"; } , @{$right;}) and (defined $down and &any(sub { $_ eq "|"; } , @{$down;}))
defined $right &any(sub { $_ eq "-"; } , @{$right;}) (defined $down and &any(sub { $_ eq "|"; } , @{$down;}))
Truth table0%0/3
A and B
A= defined $downB= &any(sub { $_ eq "|"; } , @{$down;})
ABresult
0X0
100
111
Truth table0%0/4
A and B and C
A= defined $rightB= &any(sub { $_ eq "-"; } , @{$right;})C= (defined $down and &any(sub { $_ eq "|"; } , @{$down;}))
ABCresult
0XX0
10X0
1100
1111
369 0 ▶ ((defined($right) && (any {$_ eq '-'} @{$right})) && (defined($down) && (any {$_ eq '|'} @{$down})))) ;
Subroutine __ANON__: not called CC=1 SCAR=6.9
Subroutine __ANON__: not called CC=1 SCAR=6.9
Condition0%0/12
defined $left && &any(sub { $_ eq '-'; } , @{$left;}) && (defined $down && &any(sub { $_ eq '|'; } , @{$down;})) || defined $right && &any(sub { $_ eq '-'; } , @{$right;}) && (defined $down && &any(sub { $_ eq '|'; } , @{$down;}))
l!l&&r!l&&!r
000
defined $left and &any(sub { $_ eq "-"; } , @{$left;}) and (defined $down and &any(sub { $_ eq "|"; } , @{$down;}))
!ll&&!rl&&r
000
defined $left and &any(sub { $_ eq "-"; } , @{$left;})
!ll&&!rl&&r
000
defined $down and &any(sub { $_ eq "|"; } , @{$down;})
!ll&&!rl&&r
000
MC/DC0%0/4
defined $left && &any(sub { $_ eq '-'; } , @{$left;}) && (defined $down && &any(sub { $_ eq '|'; } , @{$down;})) || defined $right && &any(sub { $_ eq '-'; } , @{$right;}) && (defined $down && &any(sub { $_ eq '|'; } , @{$down;}))
defined $left &any(sub { $_ eq "-"; } , @{$left;}) (defined $down and &any(sub { $_ eq "|"; } , @{$down;})) defined $right && &any(sub { $_ eq '-'; } , @{$right;}) && (defined $down && &any(sub { $_ eq '|'; } , @{$down;}))
MC/DC0%0/2
defined $down and &any(sub { $_ eq "|"; } , @{$down;})
defined $down &any(sub { $_ eq "|"; } , @{$down;})
Truth table0%0/7
A and B and C || D
A= defined $leftB= &any(sub { $_ eq "-"; } , @{$left;})C= (defined $down and &any(sub { $_ eq "|"; } , @{$down;}))D= defined $right && &any(sub { $_ eq '-'; } , @{$right;}) && (defined $down && &any(sub { $_ eq '|'; } , @{$down;}))
ABCDresult
111X1
0XX11
10X11
11011
0XX00
10X00
11000
Truth table0%0/3
A and B
A= defined $downB= &any(sub { $_ eq "|"; } , @{$down;})
ABresult
0X0
100
111
370 }
371  
372 #-----------------------------------------------------------------------------
373 # '
374 # | | |
375 # | | |
376 # '--- ---' ---'---
377 sub scene_apostrophe
378 0 ▶{
Subroutine scene_apostrophe: not called CC=14 SCAR=53.5
Pod undocumented
379 0 my ($up, $down, $left, $right, $char_category_indexs) = @_;
380  
381 0 ▶return 1 if(((defined($up) && (any {$_ eq '|'} @{$up})) && (defined($right) && (any {$_ eq '-'} @{$right}))) &&
Subroutine __ANON__: not called CC=1 SCAR=6.9
Subroutine __ANON__: not called CC=1 SCAR=6.9
Condition0%0/6
defined $right and &any(sub { $_ eq "-"; } , @{$right;})
!ll&&!rl&&r
000
defined $down && &any(sub { $_ eq '|'; } , @{$down;})
!ll&&!rl&&r
000
MC/DC0%0/2
defined $right and &any(sub { $_ eq "-"; } , @{$right;})
defined $right &any(sub { $_ eq "-"; } , @{$right;})
MC/DC0%0/2
defined $down && &any(sub { $_ eq '|'; } , @{$down;})
defined $down &any(sub { $_ eq '|'; } , @{$down;})
Truth table0%0/3
A and B
A= defined $rightB= &any(sub { $_ eq "-"; } , @{$right;})
ABresult
0X0
100
111
Truth table0%0/3
A && B
A= defined $downB= &any(sub { $_ eq '|'; } , @{$down;})
ABresult
0X0
100
111
382 0 ▶ !(defined($down) && (any {$_ eq '|'} @{$down}))) ;
Subroutine __ANON__: not called CC=1 SCAR=6.9
Branch: 1 branch
BranchTrueFalseTotal
if defined $up and &any(sub { $_ eq "|"; } , @{$up;}) and (defined $right and &any(sub { $_ eq "-"; } , @{$right;})) and not defined $down && &any(sub { $_ eq "|"; } , @{$down;}) 0 0 0
Condition0%0/9
defined $up and &any(sub { $_ eq "|"; } , @{$up;}) and (defined $right and &any(sub { $_ eq "-"; } , @{$right;})) and not defined $down && &any(sub { $_ eq "|"; } , @{$down;})
!ll&&!rl&&r
000
defined $up and &any(sub { $_ eq "|"; } , @{$up;}) and (defined $right and &any(sub { $_ eq "-"; } , @{$right;}))
!ll&&!rl&&r
000
defined $up and &any(sub { $_ eq "|"; } , @{$up;})
!ll&&!rl&&r
000
MC/DC0%0/4
defined $up and &any(sub { $_ eq "|"; } , @{$up;}) and (defined $right and &any(sub { $_ eq "-"; } , @{$right;})) and not defined $down && &any(sub { $_ eq "|"; } , @{$down;})
defined $up &any(sub { $_ eq "|"; } , @{$up;}) (defined $right and &any(sub { $_ eq "-"; } , @{$right;})) not defined $down && &any(sub { $_ eq "|"; } , @{$down;})
Truth table0%0/5
A and B and C and not(D)
A= defined $upB= &any(sub { $_ eq "|"; } , @{$up;})C= (defined $right and &any(sub { $_ eq "-"; } , @{$right;}))D= not defined $down && &any(sub { $_ eq "|"; } , @{$down;})
ABCDresult
0XXX0
10XX0
110X0
11100
11111
383  
384 0 ▶return ((defined($up) && (any {$_ eq '|'} @{$up})) && (defined($left) && (any {$_ eq '-'} @{$left})) &&
Subroutine __ANON__: not called CC=1 SCAR=6.9
Subroutine __ANON__: not called CC=1 SCAR=6.9
Condition0%0/9
defined $left and &any(sub { $_ eq "-"; } , @{$left;})
!ll&&!rl&&r
000
defined $down && &any(sub { $_ eq '|'; } , @{$down;}) || defined $right && &any(sub { $_ eq '|'; } , @{$right;})
l!l&&r!l&&!r
000
defined $down and &any(sub { $_ eq "|"; } , @{$down;})
!ll&&!rl&&r
000
MC/DC0%0/2
defined $left and &any(sub { $_ eq "-"; } , @{$left;})
defined $left &any(sub { $_ eq "-"; } , @{$left;})
MC/DC0%0/3
defined $down && &any(sub { $_ eq '|'; } , @{$down;}) || defined $right && &any(sub { $_ eq '|'; } , @{$right;})
defined $down &any(sub { $_ eq "|"; } , @{$down;}) defined $right && &any(sub { $_ eq '|'; } , @{$right;})
Truth table0%0/3
A and B
A= defined $leftB= &any(sub { $_ eq "-"; } , @{$left;})
ABresult
0X0
100
111
Truth table0%0/5
A and B || C
A= defined $downB= &any(sub { $_ eq "|"; } , @{$down;})C= defined $right && &any(sub { $_ eq '|'; } , @{$right;})
ABCresult
11X1
0X11
1011
0X00
1000
385 0 ▶ !((defined($down) && (any {$_ eq '|'} @{$down})) || (defined($right) && (any {$_ eq '|'} @{$right})))) ;
Subroutine __ANON__: not called CC=1 SCAR=6.9
Subroutine __ANON__: not called CC=1 SCAR=6.9
Condition0%0/12
defined $up && &any(sub { $_ eq '|'; } , @{$up;}) && (defined $left && &any(sub { $_ eq '-'; } , @{$left;})) && !(defined $down && &any(sub { $_ eq '|'; } , @{$down;}) || defined $right && &any(sub { $_ eq '|'; } , @{$right;}))
!ll&&!rl&&r
000
defined $up and &any(sub { $_ eq "|"; } , @{$up;}) and (defined $left and &any(sub { $_ eq "-"; } , @{$left;}))
!ll&&!rl&&r
000
defined $up and &any(sub { $_ eq "|"; } , @{$up;})
!ll&&!rl&&r
000
defined $right and &any(sub { $_ eq "|"; } , @{$right;})
!ll&&!rl&&r
000
MC/DC0%0/4
defined $up && &any(sub { $_ eq '|'; } , @{$up;}) && (defined $left && &any(sub { $_ eq '-'; } , @{$left;})) && !(defined $down && &any(sub { $_ eq '|'; } , @{$down;}) || defined $right && &any(sub { $_ eq '|'; } , @{$right;}))
defined $up &any(sub { $_ eq "|"; } , @{$up;}) (defined $left and &any(sub { $_ eq "-"; } , @{$left;})) !(defined $down && &any(sub { $_ eq '|'; } , @{$down;}) || defined $right && &any(sub { $_ eq '|'; } , @{$right;}))
MC/DC0%0/2
defined $right and &any(sub { $_ eq "|"; } , @{$right;})
defined $right &any(sub { $_ eq "|"; } , @{$right;})
Truth table0%0/5
A and B and C && not(D)
A= defined $upB= &any(sub { $_ eq "|"; } , @{$up;})C= (defined $left and &any(sub { $_ eq "-"; } , @{$left;}))D= !(defined $down && &any(sub { $_ eq '|'; } , @{$down;}) || defined $right && &any(sub { $_ eq '|'; } , @{$right;}))
ABCDresult
0XXX0
10XX0
110X0
11100
11111
Truth table0%0/3
A and B
A= defined $rightB= &any(sub { $_ eq "|"; } , @{$right;})
ABresult
0X0
100
111
386  
387 }
388  
389 sub scene_unicode
390 0 ▶{
Subroutine scene_unicode: not called CC=13 SCAR=52.0
Pod undocumented
391 0 my ($up, $down, $left, $right, $char_category_indexs) = @_;
392  
393 0 for my $char_index (@{$char_category_indexs})
394 {
395 0 ▶ if(exists $left_index_map{$char_index})
Branch: 3 branches
BranchTrueFalseTotal
if (exists $left_index_map{$char_index}) { } 0 0 0
elsif (exists $right_index_map{$char_index}) { } 0 0 0
elsif (exists $up_index_map{$char_index}) { } 0 0 0
396 {
397 0 ▶ return 0 unless defined $left;
Branch: 1 branch
BranchTrueFalseTotal
unless defined $left 0 0 0
398 0 ▶ return 0 unless any {exists $unicode_cross_chars[$char_index]{$_}} @{$left};
Subroutine __ANON__: not called CC=1 SCAR=6.9
Branch: 1 branch
BranchTrueFalseTotal
unless &any(sub { exists $unicode_cross_chars[$char_index]{$_}; } , @{$left;}) 0 0 0
399 }
400 elsif(exists $right_index_map{$char_index})
401 {
402 0 ▶ return 0 unless defined $right;
Branch: 1 branch
BranchTrueFalseTotal
unless defined $right 0 0 0
403 0 ▶ return 0 unless any {exists $unicode_cross_chars[$char_index]{$_}} @{$right};
Subroutine __ANON__: not called CC=1 SCAR=6.9
Branch: 1 branch
BranchTrueFalseTotal
unless &any(sub { exists $unicode_cross_chars[$char_index]{$_}; } , @{$right;}) 0 0 0
404 }
405 elsif(exists $up_index_map{$char_index})
406 {
407 0 ▶ return 0 unless defined $up;
Branch: 1 branch
BranchTrueFalseTotal
unless defined $up 0 0 0
408 0 ▶ return 0 unless any {exists $unicode_cross_chars[$char_index]{$_}} @{$up};
Subroutine __ANON__: not called CC=1 SCAR=6.9
Branch: 1 branch
BranchTrueFalseTotal
unless &any(sub { exists $unicode_cross_chars[$char_index]{$_}; } , @{$up;}) 0 0 0
409 }
410 else
411 {
412 0 ▶ return 0 unless defined $down;
Branch: 1 branch
BranchTrueFalseTotal
unless defined $down 0 0 0
413 0 ▶ return 0 unless any {exists $unicode_cross_chars[$char_index]{$_}} @{$down};
Subroutine __ANON__: not called CC=1 SCAR=6.9
Branch: 1 branch
BranchTrueFalseTotal
unless &any(sub { exists $unicode_cross_chars[$char_index]{$_}; } , @{$down;}) 0 0 0
414 }
415 }
416  
417 0 return 1;
418  
419 }
420  
421 #-----------------------------------------------------------------------------
422 # X
423 sub scene_x
424 0 ▶{
Subroutine scene_x: not called CC=8 SCAR=42.8
Pod undocumented
425 0 my ($char_45, $char_135, $char_225, $char_315) = @_;
426  
427 0 ▶return 0 unless defined $char_45 && defined $char_135 && defined $char_225 && defined $char_315 ;
Branch: 1 branch
BranchTrueFalseTotal
unless defined $char_45 and defined $char_135 and defined $char_225 and defined $char_315 0 0 0
Condition0%0/9
defined $char_45 and defined $char_135 and defined $char_225 and defined $char_315
!ll&&!rl&&r
000
defined $char_45 and defined $char_135 and defined $char_225
!ll&&!rl&&r
000
defined $char_45 and defined $char_135
!ll&&!rl&&r
000
MC/DC0%0/4
defined $char_45 and defined $char_135 and defined $char_225 and defined $char_315
defined $char_45 defined $char_135 defined $char_225 defined $char_315
Truth table0%0/5
A and B and C and D
A= defined $char_45B= defined $char_135C= defined $char_225D= defined $char_315
ABCDresult
0XXX0
10XX0
110X0
11100
11111
428  
429 0 ▶return (any {$_ eq '/' || $_ eq '^'} @{$char_45})
Subroutine __ANON__: not called CC=2 SCAR=17.9
Branch: 1 branch
BranchTrueFalseTotal
$_ eq "/" or $_ eq "^" 0 0 0
430 0 ▶ && (any {$_ eq '\\' || $_ eq 'v'} @{$char_135})
Subroutine __ANON__: not called CC=2 SCAR=17.9
Branch: 1 branch
BranchTrueFalseTotal
$_ eq "\\" or $_ eq "v" 0 0 0
431 0 ▶ && (any {$_ eq '/' || $_ eq 'v'} @{$char_225})
Subroutine __ANON__: not called CC=2 SCAR=17.9
Branch: 1 branch
BranchTrueFalseTotal
$_ eq "/" or $_ eq "v" 0 0 0
432 0 ▶ && (any {$_ eq '\\' || $_ eq '^'} @{$char_315}) ;
Subroutine __ANON__: not called CC=2 SCAR=17.9
Branch: 1 branch
BranchTrueFalseTotal
$_ eq "\\" or $_ eq "^" 0 0 0
Condition0%0/9
&any(sub { $_ eq '/' or $_ eq '^'; } , @{$char_45;}) && &any(sub { $_ eq '\\' or $_ eq 'v'; } , @{$char_135;}) && &any(sub { $_ eq '/' or $_ eq 'v'; } , @{$char_225;}) && &any(sub { $_ eq '\\' or $_ eq '^'; } , @{$char_315;})
!ll&&!rl&&r
000
&any(sub { $_ eq "/" or $_ eq "^"; } , @{$char_45;}) and &any(sub { $_ eq "\\" or $_ eq "v"; } , @{$char_135;}) and &any(sub { $_ eq "/" or $_ eq "v"; } , @{$char_225;})
!ll&&!rl&&r
000
&any(sub { $_ eq "/" or $_ eq "^"; } , @{$char_45;}) and &any(sub { $_ eq "\\" or $_ eq "v"; } , @{$char_135;})
!ll&&!rl&&r
000
MC/DC0%0/4
&any(sub { $_ eq '/' or $_ eq '^'; } , @{$char_45;}) && &any(sub { $_ eq '\\' or $_ eq 'v'; } , @{$char_135;}) && &any(sub { $_ eq '/' or $_ eq 'v'; } , @{$char_225;}) && &any(sub { $_ eq '\\' or $_ eq '^'; } , @{$char_315;})
&any(sub { $_ eq "/" or $_ eq "^"; } , @{$char_45;}) &any(sub { $_ eq "\\" or $_ eq "v"; } , @{$char_135;}) &any(sub { $_ eq "/" or $_ eq "v"; } , @{$char_225;}) &any(sub { $_ eq '\\' or $_ eq '^'; } , @{$char_315;})
Truth table0%0/5
A and B and C && D
A= &any(sub { $_ eq "/" or $_ eq "^"; } , @{$char_45;})B= &any(sub { $_ eq "\\" or $_ eq "v"; } , @{$char_135;})C= &any(sub { $_ eq "/" or $_ eq "v"; } , @{$char_225;})D= &any(sub { $_ eq '\\' or $_ eq '^'; } , @{$char_315;})
ABCDresult
0XXX0
10XX0
110X0
11100
11111
433 }
434  
435 #-----------------------------------------------------------------------------
436 # ╳
437 sub scene_unicode_x
438 0 ▶{
Subroutine scene_unicode_x: not called CC=8 SCAR=42.8
Pod undocumented
439 0 my ($char_45, $char_135, $char_225, $char_315) = @_;
440  
441 0 ▶return 0 unless defined $char_45 && defined $char_135 && defined $char_225 && defined $char_315 ;
Branch: 1 branch
BranchTrueFalseTotal
unless defined $char_45 and defined $char_135 and defined $char_225 and defined $char_315 0 0 0
Condition0%0/9
defined $char_45 and defined $char_135 and defined $char_225 and defined $char_315
!ll&&!rl&&r
000
defined $char_45 and defined $char_135 and defined $char_225
!ll&&!rl&&r
000
defined $char_45 and defined $char_135
!ll&&!rl&&r
000
MC/DC0%0/4
defined $char_45 and defined $char_135 and defined $char_225 and defined $char_315
defined $char_45 defined $char_135 defined $char_225 defined $char_315
Truth table0%0/5
A and B and C and D
A= defined $char_45B= defined $char_135C= defined $char_225D= defined $char_315
ABCDresult
0XXX0
10XX0
110X0
11100
11111
442  
443 0 ▶return (any {$_ eq '╱' || $_ eq '^'} @{$char_45})
Subroutine __ANON__: not called CC=2 SCAR=17.9
Branch: 1 branch
BranchTrueFalseTotal
$_ eq "\x{2571}" or $_ eq "^" 0 0 0
444 0 ▶ && (any {$_ eq '╲' || $_ eq 'v'} @{$char_135})
Subroutine __ANON__: not called CC=2 SCAR=17.9
Branch: 1 branch
BranchTrueFalseTotal
$_ eq "\x{2572}" or $_ eq "v" 0 0 0
445 0 ▶ && (any {$_ eq '╱' || $_ eq 'v'} @{$char_225})
Subroutine __ANON__: not called CC=2 SCAR=17.9
Branch: 1 branch
BranchTrueFalseTotal
$_ eq "\x{2571}" or $_ eq "v" 0 0 0
446 0 ▶ && (any {$_ eq '╲' || $_ eq '^'} @{$char_315}) ;
Subroutine __ANON__: not called CC=2 SCAR=17.9
Branch: 1 branch
BranchTrueFalseTotal
$_ eq "\x{2572}" or $_ eq "^" 0 0 0
Condition0%0/9
&any(sub { $_ eq "\x{2571}" or $_ eq '^'; } , @{$char_45;}) && &any(sub { $_ eq "\x{2572}" or $_ eq 'v'; } , @{$char_135;}) && &any(sub { $_ eq "\x{2571}" or $_ eq 'v'; } , @{$char_225;}) && &any(sub { $_ eq "\x{2572}" or $_ eq '^'; } , @{$char_315;})
!ll&&!rl&&r
000
&any(sub { $_ eq "\x{2571}" or $_ eq "^"; } , @{$char_45;}) and &any(sub { $_ eq "\x{2572}" or $_ eq "v"; } , @{$char_135;}) and &any(sub { $_ eq "\x{2571}" or $_ eq "v"; } , @{$char_225;})
!ll&&!rl&&r
000
&any(sub { $_ eq "\x{2571}" or $_ eq "^"; } , @{$char_45;}) and &any(sub { $_ eq "\x{2572}" or $_ eq "v"; } , @{$char_135;})
!ll&&!rl&&r
000
MC/DC0%0/4
&any(sub { $_ eq "\x{2571}" or $_ eq '^'; } , @{$char_45;}) && &any(sub { $_ eq "\x{2572}" or $_ eq 'v'; } , @{$char_135;}) && &any(sub { $_ eq "\x{2571}" or $_ eq 'v'; } , @{$char_225;}) && &any(sub { $_ eq "\x{2572}" or $_ eq '^'; } , @{$char_315;})
&any(sub { $_ eq "\x{2571}" or $_ eq "^"; } , @{$char_45;}) &any(sub { $_ eq "\x{2572}" or $_ eq "v"; } , @{$char_135;}) &any(sub { $_ eq "\x{2571}" or $_ eq "v"; } , @{$char_225;}) &any(sub { $_ eq "\x{2572}" or $_ eq '^'; } , @{$char_315;})
Truth table0%0/5
A and B and C && D
A= &any(sub { $_ eq "\x{2571}" or $_ eq "^"; } , @{$char_45;})B= &any(sub { $_ eq "\x{2572}" or $_ eq "v"; } , @{$char_135;})C= &any(sub { $_ eq "\x{2571}" or $_ eq "v"; } , @{$char_225;})D= &any(sub { $_ eq "\x{2572}" or $_ eq '^'; } , @{$char_315;})
ABCDresult
0XXX0
10XX0
110X0
11100
11111
447 }
448  
449 }
450  
451 #-----------------------------------------------------------------------------
452  
453 4 1 ;
454  
« blib/lib/App/Asciio/Setup.pm ↑ Summary blib/lib/App/Asciio/GTK/Asciio.pm »