lib/Net/NBName/NameQuery/RR.pm

filter: Statementstmt 86.6% 26 / 30 Branchbran 50.0% 1 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 66.6% 6 / 9 Podpod 80.0% 4 / 5 totaltotal 80.4% 37 / 46 CC 2 SCAR 4.1
CC
2
Cov
84%
new
2.0
as_string
2.0
G
2.0
CRAP 1.5
« script/nodestat.pl ↑ Summary
1 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
2 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
3
4 package Net::NBName::NameQuery::RR;
5
6 2 ▶use vars '$VERSION';
Subroutine BEGIN: called CC=1 SCAR=0.0
7 2 $VERSION = "0.26";
8
9 2 ▶use vars '@nodetypes';
Subroutine BEGIN: called CC=1 SCAR=0.0
10 2 @nodetypes = qw/B-node P-node M-node H-node/;
11
12 sub new
13 3 ▶{
Subroutine new: called CC=2 SCAR=6.9
Pod undocumented
14 3 my $class = shift;
15 3 my $nb_data = shift;
16 3 my ($flags, $packed_address) = unpack("na4", $nb_data);
17 3 my $address = join ".", unpack("C4", $packed_address);
18
19 3 my $self = {};
20 3 $self->{'address'} = $address;
21 3 ▶ $self->{'G'} = ($flags & 2**15) ? "GROUP" : "UNIQUE";
Branch: 1 branch
BranchTrueFalseTotal
$flags & 32768 ? : 3 0 3
22 3 $self->{'ONT'} = $nodetypes[($flags >> 13) & 3];
23
24 3 bless $self, $class;
25 3 return $self;
26 }
27
28 sub as_string
29 0 ▶{
Subroutine as_string: not called CC=1 SCAR=6.9
Pod documented
30 0 my $self = shift;
31
32 return sprintf "%-15s %-6s %-6s\n",
33 $self->{'address'},
34 $self->{'G'},
35 0 $self->{'ONT'};
36 }
37
38 3 ▶sub address { return $_[0]->{'address'}; }
Subroutine address: called CC=1 SCAR=0.0
Pod documented
39 0 ▶sub G { return $_[0]->{'G'}; }
Subroutine G: not called CC=1 SCAR=6.9
Pod documented
40 0 ▶sub ONT { return $_[0]->{'ONT'}; }
Subroutine ONT: not called CC=1 SCAR=6.9
Pod documented
41
42 2 1;
43
44 __END__
« script/nodestat.pl ↑ Summary