blib/lib/Net/IP/Match/Trie/XS.pm

filter: Statementstmt 100% 21 / 21 Branchbran n/a Conditioncond 50.0% 1 / 2 MC/DCmcdc 0.0% 0 / 1 Subroutinesub 100% 5 / 5 Podpod 33.3% 1 / 3 totaltotal 87.5% 28 / 32 SCAR 11.0
CC
3
Cov
96%
add
3.0
BEGIN
1.0
BEGIN
1.0
CRAP 3.0
« blib/lib/Net/IP/Match/Trie.pm ↑ Summary Trie.xs »
1 # -*- mode: coding: utf-8; -*-
2 package Net::IP::Match::Trie;
3  
4 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 2 our $VERSION = '0.01_01';
8  
9 2 require XSLoader;
10 2 XSLoader::load(__PACKAGE__, $VERSION);
11  
12 sub new {
13 1 ▶ my($class, %opt) = @_;
Subroutine new: called CC=1 SCAR=0.0
Pod undocumented
14 1 my $self = bless {}, $class;
15 1 $self->_initialize();
16 1 return $self;
17 }
18  
19 # name => [ cidr1, cidr2, ... ]
20 sub add {
21 4 ▶ my($self, $name, $cidrs) = @_;
Subroutine add: called CC=3 SCAR=11.1
Pod documented
22  
23 4 for my $cidr (@$cidrs) {
24 6 my($network, $netmask) = split m{/}, $cidr;
25 6 ▶ $netmask ||= 32;
Condition50%1/2
$netmask ||= 32
l!l
60
MC/DC0%0/1
$netmask ||= 32
$netmask
Truth table50%1/2
A
A= $netmask
Aresult
11
00
26 6 $self->_add($name, $network, $netmask);
27 }
28 }
29  
30 sub impl {
31 1 ▶ my($self) = @_;
Subroutine impl: called CC=1 SCAR=0.0
Pod undocumented
32 1 return "XS";
33 }
34  
35 2 1;
« blib/lib/Net/IP/Match/Trie.pm ↑ Summary Trie.xs »