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 CC 2 SCAR 3.7
CC
2
Cov
85%
asstring
2.0
count
2.0
remove_tail
2.0
CRAP 1.4
« 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.18';
11  
12 18 ▶sub type {
Subroutine type: called CC=1 SCAR=0.0
Pod undocumented
13 18 return 2;
14 }
15  
16 65 ▶sub length {
Subroutine length: called CC=1 SCAR=0.0
Pod undocumented
17 65 my $this = shift;
18 65 return scalar @{$this};
19 }
20  
21 0 ▶sub asstring { as_string(@_) }
Subroutine asstring: not called CC=1 SCAR=6.9
Pod undocumented
22  
23 566 ▶sub as_string {
Subroutine as_string: called CC=1 SCAR=0.0
Pod undocumented
24 566 my $this = shift;
25 566 return join(' ', @{$this});
26 }
27  
28 60 ▶sub asarray {
Subroutine asarray: called CC=1 SCAR=0.0
Pod undocumented
29 60 my $this = shift;
30 60 return [ @{$this} ]; # Unblessed version of list!
31 }
32  
33 0 ▶sub count {
Subroutine count: not called CC=1 SCAR=6.9
Pod undocumented
34 0 my $this = shift;
35  
36 0 return scalar(@{$this});
37 }
38  
39 3 ▶sub remove_tail {
Subroutine remove_tail: called CC=2 SCAR=6.9
Pod undocumented
40 3 my ($this, $cnt) = @_;
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 »