blib/lib/ExtUtils/XSpp/Exception/object.pm

filter: Statementstmt 100% 24 / 24 Branchbran 50.0% 2 / 4 Conditioncond 33.3% 2 / 6 MC/DCmcdc 0.0% 0 / 4 Subroutinesub 100% 6 / 6 Podpod 50.0% 1 / 2 totaltotal 76.0% 35 / 46 CC 5 SCAR 8.6
CC
5
Cov
82%
_dl
4.1
init
2.1
handler_code
2.0
CRAP 2.4
« blib/lib/ExtUtils/XSpp/Parser.pm ↑ Summary blib/lib/ExtUtils/XSpp/Exception/code.pm »
1 package ExtUtils::XSpp::Exception::object;
2 21 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 21 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 21 ▶use base 'ExtUtils::XSpp::Exception';
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 1 ▶sub _dl { return defined( $_[0] ) && length( $_[0] ) ? $_[0] : undef }
Subroutine _dl: called CC=3 SCAR=14.2
Branch: 1 branch
BranchTrueFalseTotal
defined $_[0] && length $_[0] ? : 1 0 1
Condition33%1/3
defined $_[0] and length $_[0]
!ll&&!rl&&r
001
MC/DC0%0/2
defined $_[0] and length $_[0]
defined $_[0] length $_[0]
Truth table33%1/3
A and B
A= defined $_[0]B= length $_[0]
ABresult
0X0
100
111
7  
8 1 ▶sub init {
Subroutine init: called CC=2 SCAR=7.4
Pod undocumented
9 1 my $this = shift;
10 1 $this->SUPER::init(@_);
11 1 my %args = @_;
12  
13 1 ▶ $this->{PERL_EXCEPTION_CLASS} = _dl( $args{perl_class} || $args{arg1} );
Condition33%1/3
$args{'perl_class'} || $args{'arg1'}
l!l&&r!l&&!r
010
MC/DC0%0/2
$args{'perl_class'} || $args{'arg1'}
$args{'perl_class'} $args{'arg1'}
Truth table33%1/3
A || B
A= $args{'perl_class'}B= $args{'arg1'}
ABresult
1X1
011
000
14 }
15  
16 1 ▶sub handler_code {
Subroutine handler_code: called CC=2 SCAR=6.9
Pod documented
17 1 my $this = shift;
18 1 my $no_spaces_indent = shift;
19 1 ▶ $no_spaces_indent = 4 if not defined $no_spaces_indent;
Branch: 1 branch
BranchTrueFalseTotal
unless defined $no_spaces_indent 1 0 1
20  
21 1 my $ctype = $this->cpp_type;
22 1 my $pclass = $this->{PERL_EXCEPTION_CLASS};
23 1 $pclass =~ s/^\s+//;
24 1 $pclass =~ s/\s+$//;
25 1 my $code = <<HERE;
26 catch ($ctype& e) {
27 SV* errsv;
28 SV* objsv;
29 objsv = eval_pv("$pclass->new()", 1);
30 errsv = get_sv("@", TRUE);
31 sv_setsv(errsv, exception_object);
32 croak(NULL);
33 }
34 HERE
35 1 return $this->indent_code($code, $no_spaces_indent);
36 }
37  
38 21 1;
« blib/lib/ExtUtils/XSpp/Parser.pm ↑ Summary blib/lib/ExtUtils/XSpp/Exception/code.pm »