Branch Coverage

lib/Nagios/Object.pm
Criterion Covered Total %
branch 99 172 57.5


line true false branch
458 1 595 ref $parent ? :
459 0 596 if @_ % 2 == 1
463 573 23 if ($type eq 'Nagios::Object' and $args{'Type'})
472 0 596 unless exists $nagios_setup{$nagios_setup_key}
481 572 24 if ($pre_link) { }
500 109 18137 if (exists $args{$key} and defined $args{$key})
505 15 94 if ($nagios_setup{$nagios_setup_key}{$key}[0] eq 'TIMERANGE')
516 1 595 if (ref $parent)
530 0 16 if not defined $text or ref $text
532 0 16 unless $text
540 38 0 unless $s
551 0 16 wantarray ? :
558 137 53 unless $range
559 53 0 unless ref $range
568 0 0 $sec == 0 ? :
598 0 5070 if $attribute eq 'register' and not defined $value
602 180 4890 if (blessed $value and UNIVERSAL::can($value, 'name')) { }
190 4700 elsif ($attrtype eq 'TIMERANGE') { }
317 4383 elsif (ref $value eq 'ARRAY') { }
611 229 346 blessed $_ ? :
614 1472 3598 if (exists $$self{$attribute} and defined $$self{$attribute}) { }
0 3598 elsif ($flatten) { }
628 11012 8991 if (exists $$self{'_use'} and blessed($$self{'_use'})) { }
67 8924 elsif ($$self{'use'}) { }
636 67 0 if (my $parser = $$self{'object_config_object'}) { }
667 55 1266 if (not $self->register) { }
672 34 1232 if ($name_method eq 'generated')
683 0 1232 if (ref $name and UNIVERSAL::can($name, 'name'))
696 0 59 if ref $$self{'name'} eq 'ARRAY'
712 95 1769 if defined $$self{'register'} and $$self{'register'} == 0
751 5070 68 if (($$package{$key}[1] & NAGIOS_PERL_ONLY()) == 0)
776 1795 9753 if (ref $type eq 'ARRAY') { }
777 1113 682 if (@$type == 1) { }
678 4 elsif (@$type > 1 and length $$type[0] == 1) { }
807 1200 0 ref $_[0] ? :
808 565 635 if ref $nagios_setup{$_[0]->setup_key}{$_[1]}[0] eq 'ARRAY'
816 541 1362 if ($_[1])
821 503 944 if ($_[1])
826 0 1142 ref $_[1] ? :
829 1142 0 defined $result ? :
833 0 0 ref $_[0] ? :
836 0 0 if (lc $key eq lc $type)
847 0 5836 unless exists $$self{$key}
852 2 5834 if (not $pre_link || $fast_mode and exists $$vf{$key})
860 0 5836 if (ref $$vf{$key}[0] eq 'ARRAY' and $value =~ /^\+(.+)$/)
864 287 5549 if (ref $$vf{$key}[0] eq 'ARRAY' and $value =~ /,/)
869 5836 0 if (defined $value) { }
883 0 2 if not defined $value and ($flags & NAGIOS_NO_INHERIT()) == NAGIOS_NO_INHERIT()
887 0 2 unless defined $value
891 0 2 if (ref $type eq 'ARRAY') { }
0 2 elsif ($type =~ /^Nagios::.*$/) { }
0 2 elsif (ref $value eq 'ARRAY' and $type ne 'TIMERANGE') { }
0 2 elsif ($type eq 'BINARY') { }
2 0 elsif ($type eq 'STRING' or $type eq 'INTEGER') { }
0 0 elsif ($type eq 'TIMERANGE') { }
894 0 0 if (@$type == 1 and $$type[0] =~ /^Nagios::.*$/) { }
897 0 0 if (ref $value ne 'ARRAY')
899 0 0 if ref $val ne $$type[0]
913 0 0 if (ref $value ne 'ARRAY')
917 0 0 unless exists $possible{$v}
923 0 0 if ref $value ne $type
930 0 0 if ref $value
932 0 0 if $value != 0 and $value != 1
935 0 2 if ref $value
937 0 2 if length $value < 1
939 0 2 if $type eq 'INTEGER' and $value =~ /[^\d]/
943 0 0 if ref $value ne 'ARRAY'
946 0 0 if ref $rng ne 'ARRAY'
948 0 0 if $$rng[0] =~ /[^\d]/ or $$rng[1] =~ /[^\d]/
966 0 0 unless ($nagios_setup{$type}{'hostgroup_name'})
969 0 0 if ($self->can('hostgroup')) { }
979 0 0 if ($self->can('hostgroup')) { }
993 0 0 if ($self->can('host_name')) { }
1003 0 0 if ($self->can('set_host_name')) { }
1042 270 4392 if $method eq 'name'
1046 18 4374 if $pkg eq 'Nagios::ServiceGroup' and $method eq 'members'
1067 11707 20003 if (defined $value or $method eq 'use') { }
1072 11014 8989 if ($template and $template->can($method))
1091 0 3 if ($method =~ /^set_(.*)$/)
1095 2 1 if (exists $nagios_setup{$setup_key}{$setup_field}) { }
1136 6 4 if ($$self{'members'}) { }
1152 4 2 if ($self->resolved) { }
1154 0 6 unless ref $item
1163 0 2 if $$self{'members'}
1165 0 2 if (ref $item eq 'ARRAY' and @$item == 2) { }
2 0 elsif (defined $item and length $item) { }