Branch Coverage

blib/lib/Mail/GPG.pm
Criterion Covered Total %
branch 161 248 64.9


line true false branch
78 81 103 if defined $passphrase
79 184 0 if $self->get_gpg_call ne ''
83 55 129 if ($options) { }
103 0 0 unless open DBG, ">$name"
104 0 0 if ($data_fh) { }
0 0 elsif (ref $data) { }
125 0 73 if $self->get_no_strict_7bit_encoding
129 0 73 unless not defined $encoding or $encoding =~ /^(quoted-printable|base64|7bit)\s*$/i
134 56 17 unless $entity->parts
153 44 16 if ($entity->effective_type =~ m[multipart/encrypted]i) { }
16 0 elsif ($entity->bodyhandle) { }
156 0 44 if $entity->parts != 2
158 0 44 unless $entity->parts(0)->effective_type =~ m[application/pgp-encrypted]i
170 0 16 unless $$encrypted_text_sref =~ /^-----BEGIN PGP MESSAGE-----/m
199 137 0 if ($data_fh_glob) { }
211 52 85 $status_fh ? :
219 94706 0 $data_fh_glob ? :
94569 137 if ($data_fh_glob ? read($data_fh, $buffer, 1024) : $data_fh->read($buffer, 1024)) { }
225 94561 8 if ($data_canonify)
246 123 1571861 if eof $stdout_fh
252 148 194 if eof $stderr_fh
257 135 204 if ($status)
259 63 416 if eof $status_fh
268 137 0 if not $data_fh and eof $stderr_fh and eof $stdout_fh and !$status_fh || eof $status_fh
314 59 0 if $] >= 5.008
333 0 274 if $debug
336 48 226 if ($fields[1] and $fields[1] =~ /^([eird])$/ or $fields[11] and $fields[11] =~ /([D])/)
339 0 48 if $verbose or $debug
345 110 116 if ($tag eq 'pub' or $tag eq 'FLUSH') { }
12 104 elsif ($tag eq 'sub' and $gpg2_mode and $fields[4]) { }
16 88 elsif ($tag eq 'uid' and $gpg2_mode and $fields[9] =~ /<[^>]+>/) { }
348 51 59 if (@ids and @emails) { }
0 59 elsif (@ids or @emails) { }
358 55 0 if $] >= 5.008
363 29 22 unless ($self->get_use_long_key_ids)
370 14 49 if ($coerce) { }
386 0 110 if defined $fields[1] and $fields[1] eq 'FLUSH'
390 71 39 if (not defined $fields[9] or $fields[9] =~ /^\s*$/) { }
39 0 elsif ($fields[9] =~ /<[^>]+>/) { }
418 0 88 if $debug
423 0 59 if $debug
472 0 35 if ($debug)
487 0 35 unless @result
488 5 30 unless wantarray
509 17 22 if ($rfc_entity->parts > 1) { }
531 17 22 if ($method eq 'sign') { }
541 9 8 if $multipart
580 17 0 unless defined $key_id
581 17 0 unless defined $passphrase
584 0 17 if $key_id eq ''
585 0 17 unless defined $passphrase
642 0 17 if $?
653 0 17 if ($self->get_debug)
698 22 0 unless defined $key_id
699 22 0 unless defined $passphrase
702 0 22 if not $_no_sign and $key_id eq ''
703 0 14 unless $_no_sign or defined $passphrase
730 0 22 if $self->get_default_key_encrypt and $self->get_default_key_id
746 8 14 if ($_no_sign) { }
778 0 22 if $?
789 0 22 if ($self->get_debug)
821 8 0 unless defined $key_id
822 8 0 unless defined $passphrase
825 0 8 if $key_id eq ''
826 0 8 unless defined $passphrase
827 0 8 unless $entity->bodyhandle
830 8 0 unless ($self->get_no_strict_7bit_encoding)
832 0 8 unless $encoding =~ /^(quoted-printable|base64|7bit)\s*$/i
883 0 8 if $?
897 0 8 if ($self->get_debug)
939 4 4 unless ($_no_sign)
940 4 0 unless defined $key_id
941 4 0 unless defined $passphrase
945 0 4 if $key_id eq ''
946 0 4 unless defined $passphrase
950 0 8 unless $entity->bodyhandle
968 0 8 if $self->get_default_key_encrypt and $self->get_default_key_id
984 4 4 if ($_no_sign) { }
1016 0 8 if $?
1027 24 32 if $tag =~ /^content/i
1035 0 8 if ($self->get_debug)
1063 30 0 unless defined $passphrase
1135 0 30 if ($is_armor and not $output_stdout =~ /^[\w-]+:/)
1142 0 30 if ($dec_entity->head->as_string eq '') { }
1149 46 120 if $tag =~ /^content/i
1158 0 30 if ($self->get_debug)
1176 0 30 unless wantarray
1195 16 8 if ($entity->effective_type =~ m[multipart/signed]i) { }
8 0 elsif ($entity->bodyhandle) { }
1198 0 16 if $entity->parts != 2
1200 0 16 unless $entity->parts(1)->effective_type =~ m[application/pgp-signature]i
1217 2 6 unless $signed_text =~ /^-----BEGIN PGP SIGNED MESSAGE-----/m
1243 16 6 if ($signature_text) { }
1293 16 6 if defined $sign_file
1296 0 22 if ($self->get_debug)
1322 22 8 if ($entity->effective_type =~ m[multipart/encrypted]i) { }
8 0 elsif ($entity->bodyhandle) { }
1325 0 22 if $entity->parts != 2
1326 0 22 unless $entity->parts(0)->effective_type =~ m[application/pgp-encrypted]i
1335 0 8 unless $entity->bodyhandle->as_string =~ /^-----BEGIN PGP MESSAGE-----/m
1351 24 10 if ($entity->effective_type =~ m[multipart/signed]i) { }
10 0 elsif ($entity->bodyhandle) { }
1354 0 24 if $entity->parts != 2
1355 0 24 unless $entity->parts(1)->effective_type =~ m[application/pgp-signature]i
1364 0 10 unless $entity->bodyhandle->as_string =~ /^-----BEGIN PGP SIGNED MESSAGE-----/m
1380 0 20 unless $mail_fh xor $mail_sref
1383 10 10 if (defined $mail_fh) { }
10 0 elsif (defined $mail_sref) { }
1392 8 74 if (m[application/pgp-signature]i)
1396 2 72 if (/^-----BEGIN PGP SIGNED MESSAGE-----/)
1412 8 2 if $$mail_sref =~ m[application/pgp-signature]i
1415 2 0 if $$mail_sref =~ /^-----BEGIN PGP SIGNED MESSAGE-----/m
1495 30 60 if $line =~ /ENC_TO\s+([^\s]+)/
1496 0 90 if $line =~ /NO_SECKEY\s+([^\s]+)/
1502 30 0 unless (exists $no_sec_keys{$k})
1512 0 30 unless wantarray
1526 30 0 $address ? :
1538 0 54 unless $mail_fh xor $mail_sref
1549 54 0 $mail_fh ? :
1554 38 16 if $entity->effective_type eq 'multipart/signed' or $entity->effective_type eq 'multipart/encrypted'
1563 16 0 if $mail_fh
1565 16 0 $mail_fh ? :
1584 0 12 if @keys > 1
1587 0 12 unless $keys[0]