Branch Coverage

blib/lib/Monitoring/TT.pm
Criterion Covered Total %
branch 15 176 8.5


line true false branch
51 0 3 if $ENV{'TEST_AUTHOR'}
52 0 3 if -f '.author'
72 0 0 unless $self->_get_options
76 0 0 unless (-d $in . '/.')
84 0 0 if (-e $$self{'out'} and not $$self{'opt'}{'force'})
86 0 0 if (scalar @files > 0)
93 0 0 if $$self{'opt'}{'templatefilter'}
94 0 0 if $$self{'opt'}{'contactfilter'}
95 0 0 if $$self{'opt'}{'hostfilter'}
104 0 0 unless $$self{'opt'}{'templatefilter'}
105 0 0 if $Monitoring::TT::Log::Verbose >= 2
122 1 2 if $$self{'_tt'}
157 0 0 unless GetOptions 'h|help', \$$self{'opt'}{'help'}, 'v|verbose', sub { $$self{'opt'}{'verbose'}++; } , 'q|quiet', \$$self{'opt'}{'quiet'}, 'V|version', \$$self{'opt'}{'version'}, 'f|force', \$$self{'opt'}{'force'}, 'cf|contactfilter=s', \$$self{'opt'}{'contactfilter'}, 'hf|hostfilter=s', \$$self{'opt'}{'hostfilter'}, 'tf|templatefilter=s', \$$self{'opt'}{'templatefilter'}, 'n|dry-run', \$$self{'opt'}{'dryrun'}, '<>', sub { push @{$$self{'opt'}{'files'};}, $_[0]; }
158 0 0 if ($$self{'opt'}{'version'})
159 0 0 if $$self{'opt'}{'help'}
160 0 0 if scalar @{$$self{'opt'}{'files'};} <= 1
164 0 0 if $$self{'opt'}{'quiet'}
165 0 0 if $$self{'opt'}{'contactfilter'}
166 0 0 if $$self{'opt'}{'hostfilter'}
167 0 0 if $$self{'opt'}{'templatefilter'}
169 0 0 if $$self{'opt'}{'dryrun'}
176 0 0 if $msg
185 0 0 if (-d $in . '/static/.')
203 0 0 if defined $$self{'opt'}{'templatefilter'} and not $file =~ /$$self{'opt'}{'templatefilter'}/mx
207 0 0 if $outfile =~ /^hosts.*\.cfg/gmx
208 0 0 if $outfile =~ /^contacts.*\.cfg/gmx
211 0 0 unless open my $fh, '>', $outfile
236 0 0 unless scalar keys %{$input_types;} > 0
251 0 0 unless defined $o
252 0 0 if defined $typefilter and not join(',', values %{$o;}) =~ /$typefilter/mx
253 0 0 if $Monitoring::TT::Log::Verbose >= 5
264 0 0 unless open my $fh, '>', $outfile
272 0 0 if defined $$self{'opt'}{'templatefilter'} and not $file =~ /$$self{'opt'}{'templatefilter'}/mx
273 0 0 if $file =~ m[^$in/conf\.d/apps]mx
274 0 0 if $file =~ m[^$in/conf\.d/contacts]mx
275 0 0 if $file =~ m[^$in/conf\.d/hosts]mx
281 0 0 unless open my $fh, '>', $outfile
303 0 0 if $num == 0
315 0 0 if ($line =~ /:(\d+)$/mx)
333 0 0 if (-e $path)
336 0 0 if defined $$self{'opt'}{'templatefilter'} and not $t =~ /$$self{'opt'}{'templatefilter'}/mx
339 0 0 $required_type ? :
0 0 scalar @{$tags;} > 0 ? :
340 0 0 if ($required_type)
352 0 0 if $required_type
361 0 0 if (defined $appdirs and scalar @{$appdirs;} > 0)
366 0 0 if (-e $path)
369 0 0 if defined $$self{'opt'}{'templatefilter'} and not $t =~ /$$self{'opt'}{'templatefilter'}/mx
371 0 0 scalar @{$apps;} > 0 ? :
388 0 0 if ($found == 0)
401 0 0 if (not -d $dir and $dir =~ /$pattern/mx)
405 0 0 unless -d $dir
406 0 0 unless opendir my $d, $dir
408 0 0 if substr($file, 0, 1) eq '.'
409 0 0 if (-d $dir . '/' . $file . '/.') { }
412 0 0 unless $file =~ /$pattern/mx
425 0 0 if (-e $in . '/config.cfg')
437 0 0 unless $self->tt->process(\$template, $data, \$output)
452 0 0 unless -d $dir . '/lib/.'
463 2 10 if defined $$uniq_libs{$inc}
470 2 2 unless defined $$uniq_types{$types}{$file}
488 0 0 if $@
494 0 0 unless defined $$input_types{$type}
504 0 0 if $$self{'opt'}{'dryrun'}
508 0 0 if (-x $hook)
510 0 0 if defined $args
519 0 0 if ($rc)
533 0 3 unless open my $fh, '<', $template
536 3 22 if ($. == 1)
538 0 3 if (substr($line, 0, 3) eq $bom)
543 3 22 if ($line =~ /^define\s+(\w+)/mox)
544 3 0 if ($1 eq 'service' or $1 eq 'host' or $1 eq 'contact') { }
573 0 0 if ($tterror =~ /input\s+text\s+line\s+(\d+)/mx)
577 0 0 if ($realfile)
584 0 0 if ($tterror =~ /var\.undef\ error\ -\ undefined\ variable:\s+(.*)$/mx)
592 0 0 if ($line =~ /\Q$err\E/mx)
594 0 0 if ($realfile)
601 0 0 unless $already_printed
612 0 0 if (defined $$lines[$x] and $$lines[$x] =~ /SRC\s+(.*):(\d+)/mx)
626 0 0 if $path eq ''
627 0 0 unless -d $path
637 0 0 if ($$o{'type'})
638 0 0 unless defined $$self{$type . 'possible_types'}{$$o{'type'}}
640 0 0 if ($$o{'tags'})
642 0 0 if substr($t, 0, 1) eq '_'
643 0 0 unless defined $$self{$type . 'possible_tags'}{$t}
646 0 0 if ($$o{'apps'})
648 0 0 unless defined $$self{$type . 'possible_apps'}{$a}