Lite/Dictionary.pm

filter: Statementstmt 24.2% 8 / 33 Branchbran 0.0% 0 / 2 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 50.0% 2 / 4 Podpod 0.0% 0 / 2 totaltotal 21.7% 10 / 46 SCAR 31.7
CC
6
Cov
21%
load
30.0
new
6.0
BEGIN
1.0
CRAP 23.7
« Lite.pm ↑ Summary Lite/FIX44.pm »
1 package FIX::Lite::Dictionary;
2  
3 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 1 my $fixDict = {};
7  
8 sub load($) {
9 0 ▶ my $ver = shift;
Subroutine load: not called CC=5 SCAR=34.0
Pod undocumented
10 0 ▶ if ( !defined $fixDict->{$ver} ) {
Branch: 1 branch
BranchTrueFalseTotal
if (not defined $fixDict->{$ver}) 0 0 0
11  
12 0 require("FIX/Lite/$ver.pm");
13  
14 0 my $f = eval "FIX::Lite::${ver}::getFix()";
15  
16 ##
17 # parse messages,fields and components and build hashes for faster access
18 #
19 0 $f->{hMessages} = {};
20 0 for my $a ( @{ $f->{messages} } ) {
21  
22 0 $f->{hMessages}->{ $a->{msgtype} } = $a;
23 0 $f->{hMessages}->{ $a->{name} } = $a;
24 }
25 0 $f->{hFields} = {};
26 0 for my $a ( @{ $f->{fields} } ) {
27 0 $f->{hFields}->{ $a->{name} } = $a;
28 0 $f->{hFields}->{ $a->{number} } = $a;
29 }
30 0 $f->{hComponents} = {};
31 0 for my $a ( @{ $f->{components} } ) {
32 0 $f->{hComponents}->{ $a->{name} } = $a;
33 }
34  
35 0 $fixDict->{$ver} = $f;
36 }
37 }
38  
39 sub new ($) {
40 0 ▶ my $proto = shift;
Subroutine new: not called CC=2 SCAR=17.9
Pod undocumented
41  
42 0 ▶ my $class = ref($proto) || $proto;
Condition0%0/3
ref $proto || $proto
l!l&&r!l&&!r
000
MC/DC0%0/2
ref $proto || $proto
ref $proto $proto
Truth table0%0/3
A || B
A= ref $protoB= $proto
ABresult
1X1
011
000
43 0 my $self = {};
44 0 bless( $self, $class );
45 0 $self = $fixDict->{FIX44};
46  
47 0 return $self;
48 }
49  
50 1 1;
« Lite.pm ↑ Summary Lite/FIX44.pm »