Farly/Transport/Port.pm

filter: Statementstmt 93.9% 31 / 33 Branchbran 83.3% 5 / 6 Conditioncond 66.6% 2 / 3 MC/DCmcdc 50.0% 1 / 2 Subroutinesub 90.9% 10 / 11 Podpod 100% 6 / 6 totaltotal 90.1% 55 / 61 CC 5 SCAR 8.8
CC
5
Cov
90%
new
5.1
iter
2.0
BEGIN
1.0
CRAP 2.4
« Farly/ASA/Generator.pm ↑ Summary Farly/IPv4/Network.pm »
1 package Farly::Transport::Port;
2
3 17 ▶use 5.008008;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 17 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 17 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 17 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 17 ▶use Farly::Transport::Object;
Subroutine BEGIN: called CC=1 SCAR=0.0
8
9 17 our @ISA = qw(Farly::Transport::Object);
10 17 our $VERSION = '0.26';
11
12 335 ▶sub new {
Subroutine new: called CC=5 SCAR=16.2
Pod documented
13 335 my ( $class, $port ) = @_;
14
15 335 ▶ confess "port required" unless ( defined($port) );
Branch: 1 branch
BranchTrueFalseTotal
unless defined $port 0 335 335
16
17 335 $port =~ s/\s+//g;
18
19 335 ▶ confess "invalid port $port"
Branch: 1 branch
BranchTrueFalseTotal
unless $port =~ /^\d+$/ 1 334 335
20 unless ( $port =~ /^\d+$/ );
21
22 334 ▶ confess "invalid port $port"
Branch: 1 branch
BranchTrueFalseTotal
unless $port > 0 and $port <= 65535 1 333 334
Condition66%2/3
$port > 0 and $port <= 65535
!ll&&!rl&&r
01333
MC/DC50%1/2
$port > 0 and $port <= 65535
$port > 0 $port <= 65535
Truth table66%2/3
A and B
A= $port > 0B= $port <= 65535
ABresult
0X0
100
111
23 unless ( $port > 0 && $port <= 65535 );
24
25 333 return bless( \$port, $class );
26 }
27
28 162 ▶sub as_string {
Subroutine as_string: called CC=1 SCAR=0.0
Pod documented
29 162 return ${ $_[0] };
30 }
31
32 447 ▶sub port {
Subroutine port: called CC=1 SCAR=0.0
Pod documented
33 447 return ${ $_[0] };
34 }
35
36 142 ▶sub first {
Subroutine first: called CC=1 SCAR=0.0
Pod documented
37 142 return ${ $_[0] };
38 }
39
40 57 ▶sub last {
Subroutine last: called CC=1 SCAR=0.0
Pod documented
41 57 return ${ $_[0] };
42 }
43
44 0 ▶sub iter {
Subroutine iter: not called CC=1 SCAR=6.9
Pod documented
45 0 my @list = ( $_[0] );
46 0 return @list;
47 }
48
49 17 1;
50 __END__
« Farly/ASA/Generator.pm ↑ Summary Farly/IPv4/Network.pm »