ObjectGroup/Network.pm

filter: Statementstmt 100% 22 / 22 Branchbran 100% 10 / 10 Conditioncond 100% 9 / 9 MC/DCmcdc 100% 6 / 6 Subroutinesub 100% 5 / 5 Podpod 0.0% 0 / 1 totaltotal 98.1% 52 / 53 CC 9 SCAR 18.8
CC
9
Cov
100%
push
9.0
BEGIN
1.0
BEGIN
1.0
CRAP 6.5
« ObjectGroup/ICMP.pm ↑ Summary ObjectGroup/Base.pm »
1 package Net::Cisco::ObjectGroup::Network;
2 2 ▶use base qw(Net::Cisco::ObjectGroup::Base);
Subroutine BEGIN: called CC=1 SCAR=0.0
3  
4 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 2 ▶use warnings FATAL => qw(all);
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 2 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 6 ▶sub push {
Subroutine push: called CC=9 SCAR=22.0
Pod undocumented
10 6 my $self = shift;
11 6 my $arg_ref = shift;
12  
13 croak 'must specify either group-object or IP network'
14 if !defined $arg_ref->{group_object}
15 6 ▶ and !defined $arg_ref->{net_addr};
Branch: 1 branch
BranchTrueFalseTotal
unless defined $arg_ref->{"group_object"} or defined $arg_ref->{"net_addr"} 1 5 6
Condition100%3/3
defined $arg_ref->{"group_object"} or defined $arg_ref->{"net_addr"}
l!l&&r!l&&!r
321
MC/DC100%2/2
defined $arg_ref->{"group_object"} or defined $arg_ref->{"net_addr"}
defined $arg_ref->{"group_object"} defined $arg_ref->{"net_addr"}
Truth table100%3/3
A or B
A= defined $arg_ref->{"group_object"}B= defined $arg_ref->{"net_addr"}
ABresult
1X1
011
000
16  
17 croak 'cannot specify both group-object and IP network'
18 if defined $arg_ref->{group_object}
19 5 ▶ and defined $arg_ref->{net_addr};
Branch: 1 branch
BranchTrueFalseTotal
if defined $arg_ref->{"group_object"} and defined $arg_ref->{"net_addr"} 1 4 5
Condition100%3/3
defined $arg_ref->{"group_object"} and defined $arg_ref->{"net_addr"}
!ll&&!rl&&r
221
MC/DC100%2/2
defined $arg_ref->{"group_object"} and defined $arg_ref->{"net_addr"}
defined $arg_ref->{"group_object"} defined $arg_ref->{"net_addr"}
Truth table100%3/3
A and B
A= defined $arg_ref->{"group_object"}B= defined $arg_ref->{"net_addr"}
ABresult
0X0
100
111
20  
21 croak 'bad group-object'
22 if defined $arg_ref->{group_object}
23 4 ▶ and ! UNIVERSAL::isa( $arg_ref->{group_object}, __PACKAGE__ );
Branch: 1 branch
BranchTrueFalseTotal
if defined $arg_ref->{"group_object"} and not UNIVERSAL::isa($arg_ref->{"group_object"}, __PACKAGE__) 1 3 4
Condition100%3/3
defined $arg_ref->{"group_object"} and not UNIVERSAL::isa($arg_ref->{"group_object"}, __PACKAGE__)
!ll&&!rl&&r
211
MC/DC100%2/2
defined $arg_ref->{"group_object"} and not UNIVERSAL::isa($arg_ref->{"group_object"}, __PACKAGE__)
defined $arg_ref->{"group_object"} not UNIVERSAL::isa($arg_ref->{"group_object"}, __PACKAGE__)
Truth table100%3/3
A and not(B)
A= defined $arg_ref->{"group_object"}B= not UNIVERSAL::isa($arg_ref->{"group_object"}, __PACKAGE__)
ABresult
0X0
100
111
24  
25 my $line = defined $arg_ref->{group_object}
26 ? 'group-object '. $arg_ref->{group_object}->get_name
27 : defined $arg_ref->{netmask}
28 3 ▶ ? "network-object $arg_ref->{net_addr} $arg_ref->{netmask}"
Branch: 2 branches
BranchTrueFalseTotal
defined $arg_ref->{'group_object'} ? : 1 2 3
defined $arg_ref->{'netmask'} ? : 1 1 2
29 : "network-object host $arg_ref->{net_addr}";
30  
31 3 push @{$self->get_objs}, $line;
32  
33 3 return $self;
34 }
35  
36 2 1;
37  
38 # Copyright (c) The University of Oxford 2006. All Rights Reserved.
39 #
40 # This program is free software; you can redistribute it and/or modify it
41 # under the terms of version 2 of the GNU General Public License as published
42 # by the Free Software Foundation.
43 #
44 # This program is distributed in the hope that it will be useful, but WITHOUT
45 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
46 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
47 # more details.
48 #
49 # You should have received a copy of the GNU General Public License along with
50 # this program; if not, write to the Free Software Foundation, Inc., 51
51 # Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
« ObjectGroup/ICMP.pm ↑ Summary ObjectGroup/Base.pm »