BGP/ASPath/AS_SEQUENCE.pm

filter: Statementstmt 84.0% 21 / 25 Branchbran 100% 2 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 75.0% 6 / 8 Podpod 0.0% 0 / 7 totaltotal 69.0% 29 / 42 SCAR 7.0
CC
2
Cov
85%
asstring
2.0
count
2.0
remove_tail
2.0
CRAP 2.0
« BGP/ASPath/AS_SET.pm ↑ Summary BGP/ASPath/AS_CONFED_SEQUENCE.pm »
1 #!/usr/bin/perl
2  
3 package Net::BGP::ASPath::AS_SEQUENCE;
4  
5 7 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 ## Inheritance and Versioning ##
8  
9 7 @Net::BGP::ASPath::AS_SEQUENCE::ISA = qw( Net::BGP::ASPath::AS );
10 7 our $VERSION = '0.16';
11  
12 sub type {
13 18 ▶ return 2;
Subroutine type: called CC=1 SCAR=0.0
Pod undocumented
14 }
15  
16 sub length {
17 66 ▶ my $this = shift;
Subroutine length: called CC=1 SCAR=0.0
Pod undocumented
18 66 return scalar @{$this};
19 }
20  
21 0 ▶sub asstring { as_string(@_) }
Subroutine asstring: not called CC=1 SCAR=6.9
Pod undocumented
22  
23 sub as_string {
24 566 ▶ my $this = shift;
Subroutine as_string: called CC=1 SCAR=0.0
Pod undocumented
25 566 return join(' ', @{$this});
26 }
27  
28 sub asarray {
29 60 ▶ my $this = shift;
Subroutine asarray: called CC=1 SCAR=0.0
Pod undocumented
30 60 return [ @{$this} ]; # Unblessed version of list!
31 }
32  
33 sub count {
34 0 ▶ my $this = shift;
Subroutine count: not called CC=1 SCAR=6.9
Pod undocumented
35  
36 0 return scalar(@{$this});
37 }
38  
39 sub remove_tail {
40 3 ▶ my ($this, $cnt) = @_;
Subroutine remove_tail: called CC=2 SCAR=6.9
Pod undocumented
41  
42 3 ▶ while ($cnt-- > 0) {
Branch: 1 branch
BranchTrueFalseTotal
if ($cnt-- > 0) 3 3 6
43 3 pop @{$this};
44 }
45  
46 3 return $this;
47 }
48  
49 7 1;
50  
« BGP/ASPath/AS_SET.pm ↑ Summary BGP/ASPath/AS_CONFED_SEQUENCE.pm »