Cplusplus/LengthVisitor.pm

filter: Statementstmt 28.0% 14 / 50 Branchbran 0.0% 0 / 8 Conditioncond 0.0% 0 / 30 MC/DCmcdc 0.0% 0 / 13 Subroutinesub 40.0% 4 / 10 Podpod 0.0% 0 / 5 totaltotal 15.5% 18 / 116 CC 17 SCAR 43.2
CC
17
Cov
16%
_get_length
156.0
visitBaseInterface
12.0
new
6.0
CRAP 75.0
« Cplusplus/IncludeVisitor.pm ↑ Summary Cplusplus/LiteralVisitor.pm »
1
2 #
3 # Interface Definition Language (OMG IDL CORBA v3.0)
4 #
5 # C++ Language Mapping Specification, New Edition June 1999
6 #
7
8 package CORBA::Cplusplus::LengthVisitor;
9
10 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
11 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
12
13 1 our $VERSION = '0.40';
14
15 1 ▶use CORBA::C::LengthVisitor;
Subroutine BEGIN: called CC=1 SCAR=0.0
16 1 ▶use base qw(CORBA::C::LengthVisitor);
Subroutine BEGIN: called CC=1 SCAR=0.0
17
18 # builds $node->{length}
19
20 0 ▶sub new {
Subroutine new: not called CC=2 SCAR=17.9
Pod undocumented
21 0 my $proto = shift;
22 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
23 0 my $self = {};
24 0 bless $self, $class;
25 0 my ($parser) = @_;
26 0 $self->{srcname} = $parser->YYData->{srcname};
27 0 $self->{symbtab} = $parser->YYData->{symbtab};
28 0 $self->{done_hash} = {};
29 0 $self->{key} = 'cpp_name';
30 0 return $self;
31 }
32
33 # See 1.9 Mapping for Structured Types
34 #
35
36 0 ▶sub _get_length {
Subroutine _get_length: not called CC=12 SCAR=50.5
37 0 my $self = shift;
38 0 my ($type) = @_;
39 0 ▶ if ( $type->isa('AnyType')
Branch: 1 branch
BranchTrueFalseTotal
if ($type->isa("AnyType") or $type->isa("SequenceType") or $type->isa("StringType") or $type->isa("WideStringType") or $type->isa("ObjectType") or $type->isa("RegularValue") or $type->isa("BoxedValue") or $type->isa("AbstractValue")) 0 0 0
Condition0%0/21
$type->isa("AnyType") or $type->isa("SequenceType") or $type->isa("StringType") or $type->isa("WideStringType") or $type->isa("ObjectType") or $type->isa("RegularValue") or $type->isa("BoxedValue") or $type->isa("AbstractValue")
l!l&&r!l&&!r
000
$type->isa("AnyType") or $type->isa("SequenceType") or $type->isa("StringType") or $type->isa("WideStringType") or $type->isa("ObjectType") or $type->isa("RegularValue") or $type->isa("BoxedValue")
l!l&&r!l&&!r
000
$type->isa("AnyType") or $type->isa("SequenceType") or $type->isa("StringType") or $type->isa("WideStringType") or $type->isa("ObjectType") or $type->isa("RegularValue")
l!l&&r!l&&!r
000
$type->isa("AnyType") or $type->isa("SequenceType") or $type->isa("StringType") or $type->isa("WideStringType") or $type->isa("ObjectType")
l!l&&r!l&&!r
000
$type->isa("AnyType") or $type->isa("SequenceType") or $type->isa("StringType") or $type->isa("WideStringType")
l!l&&r!l&&!r
000
$type->isa("AnyType") or $type->isa("SequenceType") or $type->isa("StringType")
l!l&&r!l&&!r
000
$type->isa("AnyType") or $type->isa("SequenceType")
l!l&&r!l&&!r
000
MC/DC0%0/8
$type->isa("AnyType") or $type->isa("SequenceType") or $type->isa("StringType") or $type->isa("WideStringType") or $type->isa("ObjectType") or $type->isa("RegularValue") or $type->isa("BoxedValue") or $type->isa("AbstractValue")
$type->isa("AnyType") $type->isa("SequenceType") $type->isa("StringType") $type->isa("WideStringType") $type->isa("ObjectType") $type->isa("RegularValue") $type->isa("BoxedValue") $type->isa("AbstractValue")
Truth table0%0/9
A or B or C or D or E or F or G or H
A= $type->isa("AnyType")B= $type->isa("SequenceType")C= $type->isa("StringType")D= $type->isa("WideStringType")E= $type->isa("ObjectType")F= $type->isa("RegularValue")G= $type->isa("BoxedValue")H= $type->isa("AbstractValue")
ABCDEFGHresult
1XXXXXXX1
01XXXXXX1
001XXXXX1
0001XXXX1
00001XXX1
000001XX1
0000001X1
000000011
000000000
40 or $type->isa('SequenceType')
41 or $type->isa('StringType')
42 or $type->isa('WideStringType')
43 or $type->isa('ObjectType')
44 or $type->isa('RegularValue')
45 or $type->isa('BoxedValue')
46 or $type->isa('AbstractValue') ) {
47 0 return 'variable';
48 }
49 0 ▶ if ( $type->isa('StructType')
Branch: 1 branch
BranchTrueFalseTotal
if ($type->isa("StructType") or $type->isa("UnionType") or $type->isa("TypeDeclarator")) 0 0 0
Condition0%0/6
$type->isa("StructType") or $type->isa("UnionType") or $type->isa("TypeDeclarator")
l!l&&r!l&&!r
000
$type->isa("StructType") or $type->isa("UnionType")
l!l&&r!l&&!r
000
MC/DC0%0/3
$type->isa("StructType") or $type->isa("UnionType") or $type->isa("TypeDeclarator")
$type->isa("StructType") $type->isa("UnionType") $type->isa("TypeDeclarator")
Truth table0%0/4
A or B or C
A= $type->isa("StructType")B= $type->isa("UnionType")C= $type->isa("TypeDeclarator")
ABCresult
1XX1
01X1
0011
0000
50 or $type->isa('UnionType')
51 or $type->isa('TypeDeclarator') ) {
52 0 return $type->{length};
53 }
54 0 return undef;
55 }
56
57 #
58 # 3.8 Interface Declaration
59 #
60
61 0 ▶sub visitBaseInterface {
Subroutine visitBaseInterface: not called CC=3 SCAR=24.8
Pod undocumented
62 0 my $self = shift;
63 0 my ($node) = @_;
64 0 ▶ return if (exists $node->{length});
Branch: 1 branch
BranchTrueFalseTotal
if exists $node->{"length"} 0 0 0
65 0 $node->{length} = 'variable';
66 0 foreach (@{$node->{list_export}}) {
67 0 $self->{symbtab}->Lookup($_)->visit($self);
68 }
69 }
70
71 0 ▶sub visitForwardBaseInterface {
Subroutine visitForwardBaseInterface: not called CC=2 SCAR=17.9
Pod undocumented
72 0 my $self = shift;
73 0 my ($node) = @_;
74 0 ▶ return if (exists $node->{length});
Branch: 1 branch
BranchTrueFalseTotal
if exists $node->{"length"} 0 0 0
75 0 $node->{length} = 'variable';
76 }
77
78 #
79 # 3.9 Value Declaration
80 #
81
82 0 ▶sub visitStateMember {
Subroutine visitStateMember: not called CC=1 SCAR=6.9
Pod undocumented
83 0 my $self = shift;
84 0 my ($node) = @_;
85 0 $self->_get_defn($node->{type})->visit($self);
86 }
87
88 0 ▶sub visitInitializer {
Subroutine visitInitializer: not called CC=2 SCAR=17.9
Pod undocumented
89 0 my $self = shift;
90 0 my ($node) = @_;
91 0 foreach (@{$node->{list_param}}) {
92 0 $self->_get_defn($_->{type})->visit($self);
93 }
94 }
95
96 1 1;
97
« Cplusplus/IncludeVisitor.pm ↑ Summary Cplusplus/LiteralVisitor.pm »