ObjectGroup/Protocol.pm

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