OpenPGP/ErrorHandler.pm

filter: Statementstmt 94.1% 16 / 17 Branchbran 100% 6 / 6 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 80.0% 4 / 5 Podpod 66.6% 2 / 3 totaltotal 90.3% 28 / 31 CC 4 SCAR 7.5
CC
4
Cov
96%
error
3.0
new
2.0
errstr
2.0
CRAP 2.1
« OpenPGP/Key/Public/ElGamal.pm ↑ Summary OpenPGP/Key/Public/RSA.pm »
1 package Crypt::OpenPGP::ErrorHandler;
2 16 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 16 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 16 our $VERSION = '1.21'; # VERSION
6  
7 16 our $ERROR;
8  
9 0 ▶sub new { bless {}, shift }
Subroutine new: not called CC=1 SCAR=6.9
Pod undocumented
10 10 ▶sub error {
Subroutine error: called CC=3 SCAR=11.0
Pod documented
11 10 my $msg = $_[1];
12 10 ▶ $msg .= "\n" unless $msg =~ /\n$/;
Branch: 1 branch
BranchTrueFalseTotal
unless $msg =~ /\n$/ 3 7 10
13 10 ▶ if (ref($_[0])) {
Branch: 1 branch
BranchTrueFalseTotal
if (ref $_[0]) { } 2 8 10
14 2 $_[0]->{_errstr} = $msg;
15 } else {
16 8 $ERROR = $msg;
17 }
18 10 return;
19 }
20 3 ▶sub errstr { ref($_[0]) ? $_[0]->{_errstr} : $ERROR }
Subroutine errstr: called CC=2 SCAR=6.9
Pod documented
Branch: 1 branch
BranchTrueFalseTotal
ref $_[0] ? : 1 2 3
21  
22 16 1;
23 __END__
« OpenPGP/Key/Public/ElGamal.pm ↑ Summary OpenPGP/Key/Public/RSA.pm »