lib/Net/DHCPv6/Option/MudUrl.pm

filter: Statementstmt 100% 32 / 32 Branchbran 100% 4 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 9 / 9 Podpod 100% 3 / 3 totaltotal 100% 48 / 48 CC 3 SCAR 3.1
CC
3
Cov
100%
new
2.0
from_bytes_inner
2.0
BEGIN
1.0
CRAP 1.4
« lib/Net/DHCPv6/Option/CaptivePortal.pm ↑ Summary lib/Net/DHCPv6/Option/ReconfMsg.pm »
1 #!/usr/bin/false
2 # ABSTRACT: MUD URL option (code 112) — Manufacturer Usage Description URL
3 # PODNAME: Net::DHCPv6::Option::MudUrl
4 package Net::DHCPv6::Option::MudUrl;
5 15 $Net::DHCPv6::Option::MudUrl::VERSION = '0.001';
6 15 ▶use strictures 2;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 15 ▶use Carp qw(croak);
Subroutine BEGIN: called CC=1 SCAR=0.0
8 15 ▶use Net::DHCPv6::Constants;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 15 ▶use Net::DHCPv6::X::Truncated;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 15 ▶use parent 'Net::DHCPv6::Option';
Subroutine BEGIN: called CC=1 SCAR=0.0
11 15 ▶use namespace::clean;
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 sub new {
14 4 ▶ my ( $class, %args ) = @_;
Subroutine new: called CC=2 SCAR=6.9
Pod documented
15 4 ▶ croak 'MudUrl requires url' unless defined $args{url};
Branch: 1 branch
BranchTrueFalseTotal
unless defined $args{"url"} 1 3 4
16 3 $args{code} = $OPTION_MUD_URL;
17 3 $args{data} = $args{url};
18 3 my $self = $class->SUPER::new( %args );
19 3 $self->{url} = $args{url};
20 3 bless $self, $class;
21 }
22  
23 3 ▶sub url { shift->{url} }
Subroutine url: called CC=1 SCAR=0.0
Pod documented
24  
25 sub from_bytes_inner {
26 3 ▶ my ( $class, $code, $data ) = @_;
Subroutine from_bytes_inner: called CC=2 SCAR=6.9
Pod documented
27 3 ▶ Net::DHCPv6::X::Truncated->throw( message => 'Truncated MudUrl option' )
Branch: 1 branch
BranchTrueFalseTotal
if length $data == 0 1 2 3
28 if CORE::length( $data ) == 0;
29 2 return $class->new( url => $data );
30 }
31  
32 15 $Net::DHCPv6::OptionList::OPTION_CLASS{$OPTION_MUD_URL} = __PACKAGE__;
33 15 1;
34  
35 __END__
« lib/Net/DHCPv6/Option/CaptivePortal.pm ↑ Summary lib/Net/DHCPv6/Option/ReconfMsg.pm »