ObjectGroup/ICMP.pm

filter: Statementstmt 100% 28 / 28 Branchbran 100% 10 / 10 Conditioncond 93.3% 14 / 15 MC/DCmcdc 88.8% 8 / 9 Subroutinesub 100% 6 / 6 Podpod 0.0% 0 / 1 totaltotal 95.6% 66 / 69 CC 11 SCAR 20.6
CC
11
Cov
98%
push
11.0
BEGIN
1.0
BEGIN
1.0
CRAP 7.9
« ObjectGroup/Protocol.pm ↑ Summary ObjectGroup/Network.pm »
1 package Net::Cisco::ObjectGroup::ICMP;
2 3 ▶use base qw(Net::Cisco::ObjectGroup::Base);
Subroutine BEGIN: called CC=1 SCAR=0.0
3  
4 3 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 3 ▶use warnings FATAL => qw(all);
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 3 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 4 ▶sub _init {
Subroutine _init: called CC=1 SCAR=0.0
10 4 my $self = shift;
11 4 my $arg_ref = shift;
12  
13 4 $self->set_type( 'icmp-type' );
14 4 $self->SUPER::_init( $arg_ref );
15  
16 4 return $self;
17 }
18  
19 6 ▶sub push {
Subroutine push: called CC=11 SCAR=24.0
Pod undocumented
20 6 my $self = shift;
21 6 my $arg_ref = shift;
22  
23 croak 'must specify either group-object or ICMP type'
24 if !defined $arg_ref->{group_object}
25 6 ▶ and !defined $arg_ref->{icmp_type};
Branch: 1 branch
BranchTrueFalseTotal
unless defined $arg_ref->{"group_object"} or defined $arg_ref->{"icmp_type"} 1 5 6
Condition100%3/3
defined $arg_ref->{"group_object"} or defined $arg_ref->{"icmp_type"}
l!l&&r!l&&!r
321
MC/DC100%2/2
defined $arg_ref->{"group_object"} or defined $arg_ref->{"icmp_type"}
defined $arg_ref->{"group_object"} defined $arg_ref->{"icmp_type"}
Truth table100%3/3
A or B
A= defined $arg_ref->{"group_object"}B= defined $arg_ref->{"icmp_type"}
ABresult
1X1
011
000
26  
27 croak 'cannot specify both group-object and ICMP type'
28 if defined $arg_ref->{group_object}
29 5 ▶ and defined $arg_ref->{icmp_type};
Branch: 1 branch
BranchTrueFalseTotal
if defined $arg_ref->{"group_object"} and defined $arg_ref->{"icmp_type"} 1 4 5
Condition100%3/3
defined $arg_ref->{"group_object"} and defined $arg_ref->{"icmp_type"}
!ll&&!rl&&r
221
MC/DC100%2/2
defined $arg_ref->{"group_object"} and defined $arg_ref->{"icmp_type"}
defined $arg_ref->{"group_object"} defined $arg_ref->{"icmp_type"}
Truth table100%3/3
A and B
A= defined $arg_ref->{"group_object"}B= defined $arg_ref->{"icmp_type"}
ABresult
0X0
100
111
30  
31 croak 'bad group-object'
32 if defined $arg_ref->{group_object}
33 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
34  
35  
36 $arg_ref->{icmp_type}
37 = __PACKAGE__->__dict->{$arg_ref->{icmp_type}}
38 if defined $arg_ref->{icmp_type}
39 and defined __PACKAGE__->__dict
40 3 ▶ and exists __PACKAGE__->__dict->{$arg_ref->{icmp_type}};
Branch: 1 branch
BranchTrueFalseTotal
if defined $arg_ref->{"icmp_type"} and defined __PACKAGE__->__dict and exists __PACKAGE__->__dict->{$arg_ref->{"icmp_type"}} 1 2 3
Condition83%5/6
defined $arg_ref->{"icmp_type"} and defined __PACKAGE__->__dict and exists __PACKAGE__->__dict->{$arg_ref->{"icmp_type"}}
!ll&&!rl&&r
111
defined $arg_ref->{"icmp_type"} and defined __PACKAGE__->__dict
!ll&&!rl&&r
102
MC/DC66%2/3
defined $arg_ref->{"icmp_type"} and defined __PACKAGE__->__dict and exists __PACKAGE__->__dict->{$arg_ref->{"icmp_type"}}
defined $arg_ref->{"icmp_type"} defined __PACKAGE__->__dict exists __PACKAGE__->__dict->{$arg_ref->{"icmp_type"}}
Truth table75%3/4
A and B and C
A= defined $arg_ref->{"icmp_type"}B= defined __PACKAGE__->__dictC= exists __PACKAGE__->__dict->{$arg_ref->{"icmp_type"}}
ABCresult
0XX0
10X0
1100
1111
41  
42 my $line = defined $arg_ref->{icmp_type}
43 ? "icmp-object $arg_ref->{icmp_type}"
44 3 ▶ : 'group-object '. $arg_ref->{group_object}->get_name;
Branch: 1 branch
BranchTrueFalseTotal
defined $arg_ref->{'icmp_type'} ? : 2 1 3
45  
46 3 push @{$self->get_objs}, $line;
47  
48 3 return $self;
49 }
50  
51 3 1;
52  
53 # Copyright (c) The University of Oxford 2006. All Rights Reserved.
54 #
55 # This program is free software; you can redistribute it and/or modify it
56 # under the terms of version 2 of the GNU General Public License as published
57 # by the Free Software Foundation.
58 #
59 # This program is distributed in the hope that it will be useful, but WITHOUT
60 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
61 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
62 # more details.
63 #
64 # You should have received a copy of the GNU General Public License along with
65 # this program; if not, write to the Free Software Foundation, Inc., 51
66 # Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
67  
68 __DATA__
« ObjectGroup/Protocol.pm ↑ Summary ObjectGroup/Network.pm »