Crypt/Msg.pm

filter: Statementstmt 21.7% 48 / 221 Branchbran 0.0% 0 / 54 Conditioncond 0.0% 0 / 24 MC/DCmcdc 0.0% 0 / 16 Subroutinesub 45.7% 16 / 35 Podpod 100% 11 / 11 totaltotal 20.7% 75 / 361 CC 42 SCAR 30.2
CC
42
Cov
16%
set_message
72.0
new
42.0
_check_idx
42.0
CRAP 20.6
« Crypt/Nodelist.pm ↑ Summary Crypt/Error.pm »
1 # FTN::Crypt::Msg - Message parsing for the FTN::Crypt module
2 #
3 # Copyright (C) 2019 by Petr Antonov
4 #
5 # This library is free software; you can redistribute it and/or modify it
6 # under the same terms as Perl 5.10.0. For more details, see the full text
7 # of the licenses at https://opensource.org/licenses/Artistic-1.0, and
8 # http://www.gnu.org/licenses/gpl-2.0.html.
9 #
10 # This package is provided "as is" and without any express or implied
11 # warranties, including, without limitation, the implied warranties of
12 # merchantability and fitness for a particular purpose.
13 #
14 package FTN::Crypt::Msg::MsgChunk;
15  
16 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
17 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
18 1 ▶use v5.10.1;
Subroutine BEGIN: called CC=1 SCAR=0.0
19  
20 0 ▶sub new {
Subroutine new: not called CC=1 SCAR=6.9
21 0 my $class = shift;
22  
23 0 my $self = {
24 data => [],
25 };
26
27 0 bless $self, $class;
28 }
29  
30 0 ▶sub get {
Subroutine get: not called CC=1 SCAR=6.9
31 0 my $self = shift;
32
33 0 return $self->{data};
34 }
35  
36 0 ▶sub set {
Subroutine set: not called CC=1 SCAR=6.9
37 0 my $self = shift;
38 0 my ($line) = @_;
39
40 0 push @{$self->{data}}, $line;
41 }
42  
43 #----------------------------------------------------------------------#
44  
45 package FTN::Crypt::Msg::KludgeChunk;
46  
47 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
48 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
49 1 ▶use v5.10.1;
Subroutine BEGIN: called CC=1 SCAR=0.0
50  
51 1 ▶use base qw/FTN::Crypt::Msg::MsgChunk/;
Subroutine BEGIN: called CC=1 SCAR=0.0
52  
53 0 ▶sub remove {
Subroutine remove: not called CC=3 SCAR=24.8
54 0 my $self = shift;
55 0 my ($kludge) = @_;
56
57 0 ▶ if (defined $kludge && $kludge ne '') {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $kludge and $kludge ne '') { } 0 0 0
Condition0%0/3
defined $kludge and $kludge ne ""
!ll&&!rl&&r
000
MC/DC0%0/2
defined $kludge and $kludge ne ""
defined $kludge $kludge ne ""
Truth table0%0/3
A and B
A= defined $kludgeB= $kludge ne ""
ABresult
0X0
100
111
58 0 @{$self->{data}} = grep { !/^${kludge}(?::?\s.+)*$/ }
59 0 @{$self->{data}};
60 } else {
61 0 return;
62 }
63  
64 0 return 1;
65 }
66  
67 #----------------------------------------------------------------------#
68  
69 package FTN::Crypt::Msg::TextChunk;
70  
71 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
72 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
73 1 ▶use v5.10.1;
Subroutine BEGIN: called CC=1 SCAR=0.0
74  
75 1 ▶use base qw/FTN::Crypt::Msg::MsgChunk/;
Subroutine BEGIN: called CC=1 SCAR=0.0
76  
77 0 ▶sub get {
Subroutine get: not called CC=2 SCAR=17.9
78 0 my $self = shift;
79 0 my ($ftn_ready) = @_;
80  
81 0 ▶ my $sep = $ftn_ready ? "\r" : "\n";
Branch: 1 branch
BranchTrueFalseTotal
$ftn_ready ? : 0 0 0
82  
83 0 return join $sep, @{$self->{data}};
84 }
85  
86 #----------------------------------------------------------------------#
87  
88 package FTN::Crypt::Msg;
89  
90 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
91 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
92 1 ▶use v5.10.1;
Subroutine BEGIN: called CC=1 SCAR=0.0
93  
94 1 ▶use base qw/FTN::Crypt::Error/;
Subroutine BEGIN: called CC=1 SCAR=0.0
95  
96 #----------------------------------------------------------------------#
97  
98 =head1 NAME
99  
100 FTN::Crypt::Msg - Message parsing for the L<FTN::Crypt> module.
101  
102 =head1 SYNOPSIS
103  
104 use FTN::Crypt::Msg;
105  
106 my $obj = FTN::Crypt::Msg->new(
107 Address => $ftn_address,
108 Message => $msg,
109 );
110 $obj->add_kludge('ENC: PGP5');
111 $obj->remove_kludge('ENC');
112 my $text = $obj->get_text;
113 my $kludges = $obj->get_kludges;
114 my $msg = $obj->get_message;
115  
116 =cut
117  
118 #----------------------------------------------------------------------#
119  
120 1 ▶use FTN::Address;
Subroutine BEGIN: called CC=1 SCAR=0.0
121  
122 #----------------------------------------------------------------------#
123  
124 1 my $SOH = chr(1);
125  
126 1 my %PREDEFINED_INDEX = (
127 'TOP' => 0,
128 'BOTTOM' => -1,
129 );
130 1 my %DEFAULT_INDEX = (
131 KLUDGE => 'TOP',
132 TEXT => 'BOTTOM',
133 );
134  
135 #----------------------------------------------------------------------#
136  
137 =head1 METHODS
138  
139 =cut
140  
141 #----------------------------------------------------------------------#
142  
143 =head2 new()
144  
145 Constructor.
146  
147 =head3 Parameters:
148  
149 =over 4
150  
151 =item * C<Address>: Recipient's FTN address.
152  
153 =item * C<Message>: FTN message text with kludges.
154  
155 =back
156  
157 =head3 Returns:
158  
159 Created object or error in C<FTN::Crypt::Msg-E<gt>error>.
160  
161 Sample:
162  
163 my $obj = FTN::Crypt::Msg->new(
164 Address => $ftn_address,
165 Message => $msg,
166 ) or die FTN::Crypt::Msg->error;
167  
168 =cut
169  
170 0 ▶sub new {
Subroutine new: not called CC=6 SCAR=37.4
Pod documented
171 0 my $class = shift;
172 0 my (%opts) = @_;
173  
174 0 ▶ unless (%opts) {
Branch: 1 branch
BranchTrueFalseTotal
unless (%opts) 0 0 0
175 0 $class->set_error('No options specified');
176 0 return;
177 }
178 0 ▶ unless ($opts{Address}) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($opts{"Address"}) 0 0 0
179 0 $class->set_error('No address specified');
180 0 return;
181 }
182 0 ▶ unless ($opts{Message}) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($opts{"Message"}) 0 0 0
183 0 $class->set_error('No message specified');
184 0 return;
185 }
186  
187 0 my $self = {
188 msg => [],
189 idx => {
190 KLUDGE => [],
191 TEXT => [],
192 },
193 };
194  
195 0 $self = bless $self, $class;
196  
197 0 ▶ unless ($self->set_address($opts{Address})) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($self->set_address($opts{"Address"})) 0 0 0
198 0 $class->set_error($self->error);
199 0 return;
200 }
201 0 ▶ unless ($self->set_message($opts{Message})) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($self->set_message($opts{"Message"})) 0 0 0
202 0 $class->set_error($self->error);
203 0 return;
204 }
205  
206 0 return $self;
207 }
208  
209 #----------------------------------------------------------------------#
210  
211 0 ▶sub _check_kludge {
Subroutine _check_kludge: not called CC=3 SCAR=24.8
212 0 my $self = shift;
213 0 my ($kludge) = @_;
214  
215 0 ▶ unless (defined $kludge && $kludge ne '') {
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $kludge and $kludge ne "") 0 0 0
Condition0%0/3
defined $kludge and $kludge ne ""
!ll&&!rl&&r
000
MC/DC0%0/2
defined $kludge and $kludge ne ""
defined $kludge $kludge ne ""
Truth table0%0/3
A and B
A= defined $kludgeB= $kludge ne ""
ABresult
0X0
100
111
216 0 $self->set_error('Kludge is empty');
217 0 return;
218 }
219  
220 0 return $kludge;
221 }
222  
223 #----------------------------------------------------------------------#
224  
225 0 ▶sub _check_text {
Subroutine _check_text: not called CC=3 SCAR=24.8
226 0 my $self = shift;
227 0 my ($text) = @_;
228  
229 0 ▶ unless (defined $text && $text ne '') {
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $text and $text ne "") 0 0 0
Condition0%0/3
defined $text and $text ne ""
!ll&&!rl&&r
000
MC/DC0%0/2
defined $text and $text ne ""
defined $text $text ne ""
Truth table0%0/3
A and B
A= defined $textB= $text ne ""
ABresult
0X0
100
111
230 0 $self->set_error('Text is empty');
231 0 return;
232 }
233  
234 0 return $text;
235 }
236  
237 #----------------------------------------------------------------------#
238  
239 0 ▶sub _check_idx {
Subroutine _check_idx: not called CC=6 SCAR=37.4
240 0 my $self = shift;
241 0 my ($type, $idx) = @_;
242  
243 0 ▶ unless (grep /^$type$/, keys %{$self->{idx}}) {
Branch: 1 branch
BranchTrueFalseTotal
unless (grep /^$type$/, keys %{$$self{"idx"};}) 0 0 0
244 0 $self->set_error("Invalid message area type (`$type')");
245 0 return;
246 }
247  
248 0 ▶ $idx = $DEFAULT_INDEX{$type} unless defined $idx;
Branch: 1 branch
BranchTrueFalseTotal
unless defined $idx 0 0 0
249  
250 0 ▶ $idx = $PREDEFINED_INDEX{$idx} if defined $PREDEFINED_INDEX{$idx};
Branch: 1 branch
BranchTrueFalseTotal
if defined $PREDEFINED_INDEX{$idx} 0 0 0
251
252 0 ▶ unless ($idx =~ /^-?\d+$/) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($idx =~ /^-?\d+$/) 0 0 0
253 0 $self->set_error("Invalid chunk index (`$idx')");
254 0 return;
255 }
256  
257 0 ▶ unless (defined $self->{idx}->{$type}->[$idx]) {
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $self->{"idx"}{$type}[$idx]) 0 0 0
258 0 $self->set_error("Invalid chunk index (`$idx')");
259 0 return;
260 }
261  
262 0 return $idx;
263 }
264  
265 #----------------------------------------------------------------------#
266  
267 =head2 add_kludge()
268  
269 Add kludge to the message.
270  
271 =head3 Parameters:
272  
273 =over 4
274  
275 =item * Kludge string.
276  
277 =item * B<Optional> C<[TOP|BOTTOM|<index>]> Kludges block, defaults to TOP.
278  
279 =back
280  
281 =head3 Returns:
282  
283 True or error in C<$obj-E<gt>error>.
284  
285 Sample:
286  
287 $obj->add_kludge('ENC: PGP5') or die $obj->error;
288  
289 =cut
290  
291 0 ▶sub add_kludge {
Subroutine add_kludge: not called CC=3 SCAR=24.8
Pod documented
292 0 my $self = shift;
293 0 my ($kludge, $idx) = @_;
294  
295 0 $kludge = $self->_check_kludge($kludge);
296 0 $idx = $self->_check_idx('KLUDGE', $idx);
297  
298 0 ▶ if (defined $kludge && defined $idx) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $kludge and defined $idx) { } 0 0 0
Condition0%0/3
defined $kludge and defined $idx
!ll&&!rl&&r
000
MC/DC0%0/2
defined $kludge and defined $idx
defined $kludge defined $idx
Truth table0%0/3
A and B
A= defined $kludgeB= defined $idx
ABresult
0X0
100
111
299 0 $self->{msg}->[$self->{idx}->{KLUDGE}->[$idx]]->set($kludge);
300 } else {
301 0 return;
302 }
303  
304 0 return 1;
305 }
306  
307 #----------------------------------------------------------------------#
308  
309 =head2 remove_kludge()
310  
311 Remove kludge from the message.
312  
313 =head3 Parameters:
314  
315 =over 4
316  
317 =item * Kludge string, may be only the first part of the composite kludge.
318  
319 =item * B<Optional> C<[TOP|BOTTOM|<index>]> Kludges block, defaults to TOP.
320  
321 =back
322  
323 =head3 Returns:
324  
325 True or error in C<$obj-E<gt>error>.
326  
327 Sample:
328  
329 $obj->remove_kludge('ENC') or die $obj->error;
330  
331 =cut
332  
333 0 ▶sub remove_kludge {
Subroutine remove_kludge: not called CC=3 SCAR=24.8
Pod documented
334 0 my $self = shift;
335 0 my ($kludge, $idx) = @_;
336  
337 0 $kludge = $self->_check_kludge($kludge);
338 0 $idx = $self->_check_idx('KLUDGE', $idx);
339  
340 0 ▶ if (defined $kludge && defined $idx) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $kludge and defined $idx) { } 0 0 0
Condition0%0/3
defined $kludge and defined $idx
!ll&&!rl&&r
000
MC/DC0%0/2
defined $kludge and defined $idx
defined $kludge defined $idx
Truth table0%0/3
A and B
A= defined $kludgeB= defined $idx
ABresult
0X0
100
111
341 0 $self->{msg}->[$self->{idx}->{KLUDGE}->[$idx]]->remove($kludge);
342 } else {
343 0 return;
344 }
345  
346 0 return 1;
347 }
348  
349 #----------------------------------------------------------------------#
350  
351 =head2 get_kludges()
352  
353 Get message kludges.
354  
355 =head3 Parameters:
356  
357 None.
358  
359 =head3 Returns:
360  
361 Arrayref with kludges list or error in C<$obj-E<gt>error>.
362  
363 Sample:
364  
365 $obj->get_kludges() or die $obj->error;
366  
367 =cut
368  
369 0 ▶sub get_kludges {
Subroutine get_kludges: not called CC=3 SCAR=24.8
Pod documented
370 0 my $self = shift;
371  
372 0 my $kludges = [];
373 0 foreach my $c (@{$self->{msg}}) {
374 0 ▶ push @{$kludges}, $c->get if $c->isa('FTN::Crypt::Msg::KludgeChunk');
Branch: 1 branch
BranchTrueFalseTotal
if $c->isa("FTN::Crypt::Msg::KludgeChunk") 0 0 0
375 }
376  
377 0 return $kludges;
378 }
379  
380 #----------------------------------------------------------------------#
381  
382 =head2 get_address()
383  
384 Get recipient's FTN address.
385  
386 =head3 Parameters:
387  
388 None.
389  
390 =head3 Returns:
391  
392 Recipient's FTN address or error in C<$obj-E<gt>error>.
393  
394 Sample:
395  
396 my $ftn_address = $obj->get_address() or die $obj->error;
397  
398 =cut
399  
400 0 ▶sub get_address {
Subroutine get_address: not called CC=2 SCAR=17.9
Pod documented
401 0 my $self = shift;
402  
403 0 my $addr = $self->{addr}->get;
404 0 ▶ unless ($addr) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($addr) 0 0 0
405 0 $self->set_error($@);
406 0 return;
407 }
408  
409 0 return $addr;
410 }
411  
412 #----------------------------------------------------------------------#
413  
414 =head2 set_address()
415  
416 Set recipient's FTN address.
417  
418 =head3 Parameters:
419  
420 =over 4
421  
422 =item * Recipient's FTN address.
423  
424 =back
425  
426 =head3 Returns:
427  
428 True or error in C<$obj-E<gt>error>.
429  
430 Sample:
431  
432 $obj->set_address($ftn_address)
433  
434 =cut
435  
436 0 ▶sub set_address {
Subroutine set_address: not called CC=2 SCAR=17.9
Pod documented
437 0 my $self = shift;
438 0 my ($addr) = @_;
439  
440 0 $self->{addr} = FTN::Address->new($addr);
441 0 ▶ unless ($self->{addr}) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($self->{"addr"}) 0 0 0
442 0 $self->set_error($@);
443 0 return;
444 }
445  
446 0 return 1;
447 }
448  
449 #----------------------------------------------------------------------#
450  
451 =head2 get_text()
452  
453 Get text part of the message.
454  
455 =head3 Parameters:
456  
457 =over 4
458  
459 =item * B<Optional> C<[TOP|BOTTOM|<index>]> Text block, defaults to BOTTOM.
460  
461 =back
462  
463 =head3 Returns:
464  
465 Text part of the message or error in C<$obj-E<gt>error>.
466  
467 Sample:
468  
469 my $text = $obj->get_text() or die $obj->error;
470  
471 =cut
472  
473 0 ▶sub get_text {
Subroutine get_text: not called CC=2 SCAR=17.9
Pod documented
474 0 my $self = shift;
475 0 my ($idx) = @_;
476  
477 0 $idx = $self->_check_idx('TEXT', $idx);
478  
479 0 my $text = '';
480 0 ▶ if (defined $idx) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $idx) { } 0 0 0
481 0 $text = $self->{msg}->[$self->{idx}->{TEXT}->[$idx]]->get;
482 } else {
483 0 return;
484 }
485  
486 0 return $text;
487 }
488  
489 #----------------------------------------------------------------------#
490  
491 =head2 get_all_text()
492  
493 Get all text parts of the message.
494  
495 =head3 Parameters:
496  
497 None.
498  
499 =head3 Returns:
500  
501 Arrayref with text parts of the message or error in C<$obj-E<gt>error>.
502  
503 Sample:
504  
505 my $text = $obj->get_all_text() or die $obj->error;
506  
507 =cut
508  
509 0 ▶sub get_all_text {
Subroutine get_all_text: not called CC=3 SCAR=24.8
Pod documented
510 0 my $self = shift;
511  
512 0 my $text = [];
513 0 foreach my $c (@{$self->{msg}}) {
514 0 ▶ push @{$text}, $c->get if $c->isa('FTN::Crypt::Msg::TextChunk');
Branch: 1 branch
BranchTrueFalseTotal
if $c->isa("FTN::Crypt::Msg::TextChunk") 0 0 0
515 }
516  
517 0 return $text;
518 }
519  
520 #----------------------------------------------------------------------#
521  
522 =head2 set_text()
523  
524 Set text part of the message.
525  
526 =head3 Parameters:
527  
528 =over 4
529  
530 =item * Text part of the message.
531  
532 =item * B<Optional> C<[TOP|BOTTOM|<index>]> Text block, defaults to BOTTOM.
533  
534 =back
535  
536 =head3 Returns:
537  
538 True or error in C<$obj-E<gt>error>.
539  
540 Sample:
541  
542 $obj->set_text($text) or die $obj->error;
543  
544 =cut
545  
546 0 ▶sub set_text {
Subroutine set_text: not called CC=4 SCAR=30.0
Pod documented
547 0 my $self = shift;
548 0 my ($text, $idx) = @_;
549  
550 0 $text = $self->_check_text($text);
551 0 $idx = $self->_check_idx('TEXT', $idx);
552  
553 0 ▶ if (defined $text && defined $idx) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $text and defined $idx) { } 0 0 0
Condition0%0/3
defined $text and defined $idx
!ll&&!rl&&r
000
MC/DC0%0/2
defined $text and defined $idx
defined $text defined $idx
Truth table0%0/3
A and B
A= defined $textB= defined $idx
ABresult
0X0
100
111
554 0 $self->{msg}->[$self->{idx}->{TEXT}->[$idx]] = FTN::Crypt::Msg::TextChunk->new;
555 0 $text =~ s/\r\n/\r/g;
556 0 $text =~ s/\n/\r/g;
557 0 my @text_lines = split /\r/, $text;
558 0 foreach my $l (@text_lines) {
559 0 $self->{msg}->[$self->{idx}->{TEXT}->[$idx]]->set($l);
560 }
561 } else {
562 0 return;
563 }
564  
565 0 return 1;
566 }
567  
568 #----------------------------------------------------------------------#
569  
570 =head2 get_message()
571  
572 Get FTN message text with kludges.
573  
574 =head3 Parameters:
575  
576 None.
577  
578 =head3 Returns:
579  
580 FTN message text with kludges or error in C<$obj-E<gt>error>.
581  
582 Sample:
583  
584 my $msg = $obj->get_message() or die $obj->error;
585  
586 =cut
587  
588 0 ▶sub get_message {
Subroutine get_message: not called CC=4 SCAR=30.0
Pod documented
589 0 my $self = shift;
590  
591 0 my @msg;
592 0 foreach my $c (@{$self->{msg}}) {
593 0 ▶ if ($c->isa('FTN::Crypt::Msg::KludgeChunk')) {
Branch: 2 branches
BranchTrueFalseTotal
if ($c->isa('FTN::Crypt::Msg::KludgeChunk')) { } 0 0 0
elsif ($c->isa('FTN::Crypt::Msg::TextChunk')) { } 0 0 0
594 0 push @msg, join "\r", map { "${SOH}$_" } @{$c->get};
595 } elsif ($c->isa('FTN::Crypt::Msg::TextChunk')) {
596 0 push @msg, $c->get(1);
597 }
598 }
599  
600 0 my $msg_out = join "\r", @msg;
601
602 0 return $msg_out;
603 }
604  
605 #----------------------------------------------------------------------#
606  
607 =head2 set_message()
608  
609 Set FTN message text with kludges.
610  
611 =head3 Parameters:
612  
613 =over 4
614  
615 =item * FTN message text with kludges.
616  
617 =back
618  
619 =head3 Returns:
620  
621 True or error in C<$obj-E<gt>error>.
622  
623 Sample:
624  
625 $obj->set_message($msg) or die $obj->error;
626  
627 =cut
628  
629 0 ▶sub set_message {
Subroutine set_message: not called CC=8 SCAR=42.8
Pod documented
630 0 my $self = shift;
631 0 my ($msg) = @_;
632  
633 0 $self->{msg} = [];
634 0 foreach my $a (keys %{$self->{idx}}) {
635 0 $self->{idx}->{$a} = [];
636 }
637  
638 0 $msg =~ s/\r\n/\r/g;
639 0 $msg =~ s/\n/\r/g;
640 0 my @msg_lines = split /\r/, $msg;
641  
642 0 my $is_kludge;
643 0 foreach my $l (@msg_lines) {
644 0 ▶ if ($l =~ s/^${SOH}//) {
Branch: 1 branch
BranchTrueFalseTotal
if ($l =~ s/^$SOH//) { } 0 0 0
645 0 ▶ if (!defined $is_kludge || !$is_kludge) {
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $is_kludge and $is_kludge) 0 0 0
Condition0%0/3
defined $is_kludge and $is_kludge
!ll&&!rl&&r
000
MC/DC0%0/2
defined $is_kludge and $is_kludge
defined $is_kludge $is_kludge
Truth table0%0/3
A and B
A= defined $is_kludgeB= $is_kludge
ABresult
0X0
100
111
646 0 push @{$self->{msg}}, FTN::Crypt::Msg::KludgeChunk->new;
647 0 push @{$self->{idx}->{KLUDGE}}, $#{$self->{msg}};
648 0 $is_kludge = 1;
649 }
650 } else {
651 0 ▶ if (!defined $is_kludge || $is_kludge) {
Branch: 1 branch
BranchTrueFalseTotal
if (not defined $is_kludge or $is_kludge) 0 0 0
Condition0%0/3
not defined $is_kludge or $is_kludge
l!l&&r!l&&!r
000
MC/DC0%0/2
not defined $is_kludge or $is_kludge
not defined $is_kludge $is_kludge
Truth table0%0/3
not(A) or B
A= not defined $is_kludgeB= $is_kludge
ABresult
1X1
011
000
652 0 push @{$self->{msg}}, FTN::Crypt::Msg::TextChunk->new;
653 0 push @{$self->{idx}->{TEXT}}, $#{$self->{msg}};
654 0 $is_kludge = 0;
655 }
656 }
657 0 $self->{msg}->[-1]->set($l);
658 }
659  
660 0 return 1;
661 }
662  
663 1 1;
664 __END__
« Crypt/Nodelist.pm ↑ Summary Crypt/Error.pm »