Branch Coverage

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


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}
87 16 28 if (length $_ == 1) { }
95 24 2 if ($type) { }
0 2 elsif ($label) { }
96 10 14 if ($label) { }
100 8 6 $type eq 'i' ? :
118 16 56 if (exists $DEFER_ARGS{$$_{'name'}}) { }
127 4 68 ref $$arg{'help'} && ref $$arg{'help'} eq 'ARRAY' ? :
128 4 68 $$arg{'label'} && ref $$arg{'label'} && ref $$arg{'label'} eq 'ARRAY' ? :
133 52 26 if ($help =~ /^\s*-/) { }
138 6 20 if $i < $#$help_array
143 12 60 if ($help_string =~ /%s/) { }
144 12 0 defined $$arg{'default'} ? :
168 5 1 if $$self{'_attr'}{'url'}
181 4 0 $self->_usage ? :
182 4 0 $self->_options ? :
201 35 369 if (defined $$self{$name}) { }
218 2 286 if ($$arg{'required'} and not defined $$self{$$arg{'name'}})
222 2 22 if (@missing)
234 2 30 if $$self{'usage'}
235 2 28 if $$self{'version'}
236 4 24 if $$self{'help'}
250 0 15 if $@
256 3 12 unless exists $$Config{$section}
266 12 13 if defined $$self{'_spec'}
275 0 65 if (/\s/ and /^[^"']/ || /[^"']$/) { }
1 64 elsif ($_ eq '') { }
298 39 229 if $key =~ /^_/
301 26 203 if exists $DEFAULT{$key} and $$hash{$key} eq $DEFAULT{$key}
302 52 151 if grep {$key eq $_;} 'help', 'usage', 'version', 'extra-opts'
303 102 49 unless defined $$hash{$key}
307 47 2 if ($spec =~ /[=:].+$/) { }
309 30 17 ref $$hash{$key} eq 'ARRAY' ? :
311 33 32 if (length $key > 1) { }
322 0 2 length $key > 1 ? :
326 12 13 wantarray ? :
344 0 15 if ($extopts =~ /^([^\@]*)@(.*?)\s*$/)
359 2 30 if $$args{'verbose'} and $$args{'verbose'} >= 3
373 177 17 if ($_[0] =~ /^(spec|help|required|default)$/ and scalar(@_) % 2 == 0) { }
414 0 35 unless $ok
422 0 32 unless $ok