Branch Coverage

blib/lib/Monitoring/Plugin/Getopt.pm
Criterion Covered Total %
branch 78 88 88.6


line true false branch
65 4 10 unless substr($msg, -1) eq "\n"
74 12 12 unless defined $extra
75 5 19 unless $$self{'_attr'}{$item}
88 24 36 if (length $_ == 1) { }
96 32 2 if ($type) { }
0 2 elsif ($label) { }
97 22 10 unless ($label)
98 14 8 if ($type eq 'i' or $type eq '+' or $type =~ /\d+/) { }
106 8 24 if ($optional) { }
128 16 64 if (exists $DEFER_ARGS{$$_{'name'}}) { }
137 4 76 ref $$arg{'help'} && ref $$arg{'help'} eq 'ARRAY' ? :
138 4 76 $$arg{'label'} && ref $$arg{'label'} && ref $$arg{'label'} eq 'ARRAY' ? :
143 52 34 if ($help =~ /^\s*-/) { }
148 6 28 if $i < $#$help_array
153 12 68 if ($help_string =~ /%s/) { }
154 12 0 defined $$arg{'default'} ? :
180 5 1 if $$self{'_attr'}{'url'}
193 4 0 $self->_usage ? :
194 4 0 $self->_options ? :
213 35 373 if (defined $$self{$name}) { }
230 2 286 if ($$arg{'required'} and not defined $$self{$$arg{'name'}})
234 2 22 if (@missing)
246 2 30 if $$self{'usage'}
247 2 28 if $$self{'version'}
248 4 24 if $$self{'help'}
262 0 15 if $@
268 3 12 unless exists $$Config{$section}
278 12 13 if defined $$self{'_spec'}
287 0 65 if (/\s/ and /^[^"']/ || /[^"']$/) { }
1 64 elsif ($_ eq '') { }
310 39 229 if $key =~ /^_/
313 26 203 if exists $DEFAULT{$key} and $$hash{$key} eq $DEFAULT{$key}
314 52 151 if grep {$key eq $_;} 'help', 'usage', 'version', 'extra-opts'
315 102 49 unless defined $$hash{$key}
319 47 2 if ($spec =~ /[=:].+$/) { }
321 30 17 ref $$hash{$key} eq 'ARRAY' ? :
323 33 32 if (length $key > 1) { }
334 0 2 length $key > 1 ? :
338 12 13 wantarray ? :
356 0 15 if ($extopts =~ /^([^\@]*)@(.*?)\s*$/)
371 2 30 if $$args{'verbose'} and $$args{'verbose'} >= 3
385 181 17 if ($_[0] =~ /^(spec|help|required|default)$/ and scalar(@_) % 2 == 0) { }
426 0 35 unless $ok
434 0 32 unless $ok