IDL/Definition.pm

filter: Statementstmt 41.6% 10 / 24 Branchbran 0.0% 0 / 8 Conditioncond 0.0% 0 / 2 MC/DCmcdc 0.0% 0 / 1 Subroutinesub 60.0% 3 / 5 Podpod 100% 2 / 2 totaltotal 35.7% 15 / 42 CC 6 SCAR 28.0
CC
6
Cov
29%
full_name
30.0
local_name
6.0
BEGIN
1.0
CRAP 16.5
« IDL/DocumentHeader.pm ↑ Summary Parser/Type/set.pm »
1 package Thrift::IDL::Definition;
2  
3 =head1 NAME
4  
5 Thrift::IDL::Definition
6  
7 =head1 DESCRIPTION
8  
9 Inherits from L<Thrift::IDL::Base>
10  
11 =cut
12  
13 4 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
14 4 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
15 4 ▶use base qw(Thrift::IDL::Base);
Subroutine BEGIN: called CC=1 SCAR=0.0
16  
17 =head1 METHODS
18  
19 =head2 full_name
20  
21 =cut
22  
23 0 ▶sub full_name {
Subroutine full_name: not called CC=5 SCAR=34.0
Pod documented
24 0 my $self = shift;
25  
26 0 ▶ if (! $self->can('name')) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($self->can("name")) 0 0 0
27 0 die ref($self)."->full_name() doesn't make contextual sense";
28 }
29 0 ▶ if (! $self->{header}) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($self->{"header"}) 0 0 0
30 0 die ref($self)."->full_name() has no header to compute the full name from";
31 }
32 0 my @parts = split /\./, $self->name;
33 0 ▶ if (int @parts > 1) {
Branch: 1 branch
BranchTrueFalseTotal
if (int @parts > 1) { } 0 0 0
34 0 return $self->name;
35 }
36 else {
37 0 ▶ return join '.', $self->{header}->basename || '', $self->name;
Condition0%0/2
$self->{'header'}->basename || ''
l!l
00
MC/DC0%0/1
$self->{'header'}->basename || ''
$self->{'header'}->basename
Truth table0%0/2
A
A= $self->{'header'}->basename
Aresult
11
00
38 }
39 }
40  
41 =head2 local_name
42  
43 Returns the last part of the full_name.
44  
45 =cut
46  
47 0 ▶sub local_name {
Subroutine local_name: not called CC=2 SCAR=17.9
Pod documented
48 0 my $self = shift;
49 0 ▶ if (! $self->can('name')) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($self->can("name")) 0 0 0
50 0 die ref($self)."->local_name() doesn't make contextual sense";
51 }
52 0 my @parts = split /\./, $self->name;
53 0 return $parts[ $#parts ];
54 }
55  
56 4 1;
« IDL/DocumentHeader.pm ↑ Summary Parser/Type/set.pm »