Remote/Protocol.pm

filter: Statementstmt 100% 48 / 48 Branchbran 50.0% 1 / 2 Conditioncond 40.0% 2 / 5 MC/DCmcdc 0.0% 0 / 3 Subroutinesub 100% 15 / 15 Podpod 0.0% 0 / 1 totaltotal 89.1% 66 / 74 SCAR 13.9
CC
4
Cov
93%
load_implementation
4.6
BEGIN
1.0
BEGIN
1.0
CRAP 4.0
« Remote/Storable.pm ↑ Summary
1 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
2 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 package Net::IMP::Remote::Protocol;
4 2 ▶use Scalar::Util 'dualvar';
Subroutine BEGIN: called CC=1 SCAR=0.0
5 2 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 2 ▶use Exporter 'import';
Subroutine BEGIN: called CC=1 SCAR=0.0
8 2 our @EXPORT = qw(
9 IMPRPC_GET_INTERFACE
10 IMPRPC_SET_INTERFACE
11 IMPRPC_NEW_ANALYZER
12 IMPRPC_DEL_ANALYZER
13 IMPRPC_DATA
14 IMPRPC_SET_VERSION
15 IMPRPC_EXCEPTION
16 IMPRPC_INTERFACE
17 IMPRPC_RESULT
18 );
19  
20  
21 2 ▶use constant IMPRPC_GET_INTERFACE => dualvar(0x4001,'get_interface');
Subroutine BEGIN: called CC=1 SCAR=0.0
22 2 ▶use constant IMPRPC_SET_INTERFACE => dualvar(0x4002,'set_interface');
Subroutine BEGIN: called CC=1 SCAR=0.0
23 2 ▶use constant IMPRPC_NEW_ANALYZER => dualvar(0x4003,'new_analyzer');
Subroutine BEGIN: called CC=1 SCAR=0.0
24 2 ▶use constant IMPRPC_DEL_ANALYZER => dualvar(0x4004,'delete_analyzer');
Subroutine BEGIN: called CC=1 SCAR=0.0
25 2 ▶use constant IMPRPC_DATA => dualvar(0x4005,'data');
Subroutine BEGIN: called CC=1 SCAR=0.0
26 2 ▶use constant IMPRPC_SET_VERSION => dualvar(0x4006,'set_version');
Subroutine BEGIN: called CC=1 SCAR=0.0
27  
28 2 ▶use constant IMPRPC_EXCEPTION => dualvar(0x4101,'exception');
Subroutine BEGIN: called CC=1 SCAR=0.0
29 2 ▶use constant IMPRPC_INTERFACE => dualvar(0x4102,'interface');
Subroutine BEGIN: called CC=1 SCAR=0.0
30 2 ▶use constant IMPRPC_RESULT => dualvar(0x4103,'result');
Subroutine BEGIN: called CC=1 SCAR=0.0
31  
32 sub load_implementation {
33 2 ▶ shift;
Subroutine load_implementation: called CC=4 SCAR=15.2
Pod undocumented
34 2 ▶ my $impl = shift || 'Storable';
Condition50%1/2
shift() || 'Storable'
l!l
20
MC/DC0%0/1
shift() || 'Storable'
shift()
Truth table50%1/2
A
A= shift()
Aresult
11
00
35 2 $impl = "Net::IMP::Remote::$impl";
36 2 ▶ $impl =~m{^[\w:]+$} and eval "require $impl"
Branch: 1 branch
BranchTrueFalseTotal
$impl =~ /^[\w:]+$/ and eval "require $impl" or croak("bad wire implementation ${impl}: $@") 0 2 2
Condition33%1/3
$impl =~ /^[\w:]+$/ and eval "require $impl"
!ll&&!rl&&r
002
MC/DC0%0/2
$impl =~ /^[\w:]+$/ and eval "require $impl"
$impl =~ /^[\w:]+$/ eval "require $impl"
Truth table33%1/3
A and B
A= $impl =~ /^[\w:]+$/B= eval "require $impl"
ABresult
0X0
100
111
37 or croak("bad wire implementation $impl: $@");
38 2 return $impl;
39 }
40  
41  
42  
43 __END__
« Remote/Storable.pm ↑ Summary