Branch Coverage

blib/lib/Nagios/Plugin/Getopt.pm
Criterion Covered Total %
branch 76 86 88.3


line true false branch
62 3 10 unless substr($msg, -1) eq "\n"
71 12 12 unless defined $extra
72 5 19 unless $$self{'_attr'}{$item}
84 16 28 if (length $_ == 1) { }
92 24 2 if ($type) { }
0 2 elsif ($label) { }
93 10 14 if ($label) { }
97 8 6 $type eq 'i' ? :
115 16 56 if (exists $DEFER_ARGS{$$_{'name'}}) { }
124 4 68 ref $$arg{'help'} && ref $$arg{'help'} eq 'ARRAY' ? :
125 4 68 $$arg{'label'} && ref $$arg{'label'} && ref $$arg{'label'} eq 'ARRAY' ? :
130 52 26 if ($help =~ /^\s*-/) { }
135 6 20 if $i < $#$help_array
140 12 60 if ($help_string =~ /%s/) { }
141 12 0 defined $$arg{'default'} ? :
165 5 1 if $$self{'_attr'}{'url'}
178 4 0 $self->_usage ? :
179 4 0 $self->_options ? :
198 33 339 if (defined $$self{$name}) { }
215 2 270 if ($$arg{'required'} and not defined $$self{$$arg{'name'}})
219 2 21 if (@missing)
231 2 29 if $$self{'usage'}
232 2 27 if $$self{'version'}
233 4 23 if $$self{'help'}
247 0 13 if $@
252 2 11 unless exists $$Config{$section}
262 11 12 if defined $$self{'_spec'}
271 0 58 if (/\s/ and /^[^"']/ || /[^"']$/) { }
1 57 elsif ($_ eq '') { }
294 36 212 if $key =~ /^_/
297 24 188 if exists $DEFAULT{$key} and $$hash{$key} eq $DEFAULT{$key}
298 48 140 if grep {$key eq $_;} 'help', 'usage', 'version', 'extra-opts'
299 94 46 unless defined $$hash{$key}
303 44 2 if ($spec =~ /[=:].+$/) { }
305 27 17 ref $$hash{$key} eq 'ARRAY' ? :
307 32 26 if (length $key > 1) { }
318 0 2 length $key > 1 ? :
322 11 12 wantarray ? :
340 0 13 if ($extopts =~ /^(\w*)@(.*?)\s*$/)
355 2 29 if $$args{'verbose'} and $$args{'verbose'} >= 3
369 157 17 if ($_[0] =~ /^(spec|help|required|default)$/ and scalar(@_) % 2 == 0) { }
410 0 33 unless $ok
418 0 31 unless $ok