Serialized/Client.pm

filter: Statementstmt 100% 30 / 30 Branchbran 66.6% 4 / 6 Conditioncond 40.0% 2 / 5 MC/DCmcdc 0.0% 0 / 3 Subroutinesub 100% 6 / 6 Podpod 0.0% 0 / 1 totaltotal 82.3% 42 / 51 CC 6 SCAR 11.3
CC
6
Cov
88%
call
5.2
AUTOLOAD
2.0
BEGIN
1.0
CRAP 3.1
« Serialized/ACL/Group.pm ↑ Summary Serialized/ACL/Group/GDBM_File.pm »
1 #
2 # $HeadURL: https://svn.oucs.ox.ac.uk/people/oliver/pub/librpc-serialized-perl/trunk/lib/RPC/Serialized/Client.pm $
3 # $LastChangedRevision: 1323 $
4 # $LastChangedDate: 2008-10-01 16:16:56 +0100 (Wed, 01 Oct 2008) $
5 # $LastChangedBy: oliver $
6 #
7 package RPC::Serialized::Client;
8 {
9 15 $RPC::Serialized::Client::VERSION = '1.123630';
10 }
11  
12 15 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
13 15 ▶use warnings FATAL => 'all';
Subroutine BEGIN: called CC=1 SCAR=0.0
14  
15 15 ▶use base 'RPC::Serialized';
Subroutine BEGIN: called CC=1 SCAR=0.0
16  
17 15 ▶use RPC::Serialized::Exceptions;
Subroutine BEGIN: called CC=1 SCAR=0.0
18  
19 15 our $AUTOLOAD;
20  
21 19 ▶sub call {
Subroutine call: called CC=5 SCAR=16.6
Pod undocumented
22 19 my $self = shift;
23 19 my $call = shift;
24  
25 # this is where we would hack around with the RPC protocol
26 # although not the on-the-wire stuff, which is in Serialized.pm
27 19 $self->send( { CALL => $call, ARGS => \@_ } );
28 19 my $reply = $self->recv;
29  
30 19 ▶ if ( $reply->{EXCEPTION} ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($reply->{"EXCEPTION"}) 6 13 19
31 6 my $class = $reply->{EXCEPTION}->{CLASS};
32  
33 6 ▶ throw_proto 'Invalid or missing CLASS'
Branch: 1 branch
BranchTrueFalseTotal
unless $class and $class =~ /^RPC::Serialized::X(::.+)?$/ 0 6 6
Condition33%1/3
$class and $class =~ /^RPC::Serialized::X(::.+)?$/
!ll&&!rl&&r
006
MC/DC0%0/2
$class and $class =~ /^RPC::Serialized::X(::.+)?$/
$class $class =~ /^RPC::Serialized::X(::.+)?$/
Truth table33%1/3
A and B
A= $classB= $class =~ /^RPC::Serialized::X(::.+)?$/
ABresult
0X0
100
111
34 unless $class and $class =~ /^RPC::Serialized::X(::.+)?$/;
35  
36 6 ▶ my $message = $reply->{EXCEPTION}->{MESSAGE} || "";
Condition50%1/2
$reply->{'EXCEPTION'}{'MESSAGE'} || ''
l!l
60
MC/DC0%0/1
$reply->{'EXCEPTION'}{'MESSAGE'} || ''
$reply->{'EXCEPTION'}{'MESSAGE'}
Truth table50%1/2
A
A= $reply->{'EXCEPTION'}{'MESSAGE'}
Aresult
11
00
37 6 $class->throw($message);
38 }
39  
40 13 return $reply->{RESPONSE};
41 }
42  
43 19 ▶sub AUTOLOAD {
Subroutine AUTOLOAD: called CC=2 SCAR=7.0
44 19 my $self = shift;
45  
46 19 ▶ throw_app 'Object method called on class'
Branch: 1 branch
BranchTrueFalseTotal
unless ref $self 0 19 19
47 unless ref($self);
48  
49 19 ( my $call = $AUTOLOAD ) =~ s/^.*:://;
50 19 $self->call( $call, @_ );
51 }
52  
53 15 1;
54  
« Serialized/ACL/Group.pm ↑ Summary Serialized/ACL/Group/GDBM_File.pm »