Branch Coverage

blib/lib/Log/Log4perl/Config.pm
Criterion Covered Total %
branch 157 194 80.9


line true false branch
44 1 0 if defined $flag
62 6 3 if (defined $WATCHER)
64 1 5 if (defined $Log::Log4perl::Config::Watch::SIGNAL_CAUGHT) { }
75 0 9 unless defined $delay
77 0 9 if (ref $config) { }
0 9 elsif ($config =~ /^(https?|ftp|wais|gopher|file):/) { }
84 2 7 if ($delay =~ /\D/) { }
98 1 8 if (defined $opts)
99 0 1 if ref $opts ne "HASH"
105 0 9 if ($@)
106 0 0 unless defined $OLD_CONFIG
145 187 0 unless defined $data
159 1 177 if (exists $data->{'rootlogger'} and not exists $data->{'rootLogger'})
166 27 151 if (exists $data->{'rootLogger'})
172 4 174 if (exists $data->{'threshold'})
177 1 177 if (exists $data->{'oneMessagePerAppender'})
182 2 176 if (exists $data->{'utcDateTimes'})
198 162 727 if (exists $data->{$key})
208 3 220 if ($key eq 'additivity') { }
3 217 elsif ($key eq 'PatternLayout') { }
52 165 elsif ($key eq 'filter') { }
222 0 165 if (ref $value eq "ARRAY")
241 3 19 if ($data->{'filter'}{$filter_name}{'value'} eq "Log::Log4perl::Filter::Boolean")
249 4 14 if (my $code = compile_if_perl($type))
257 4 14 if (ref $type eq 'CODE') { }
262 1 13 unless Log::Log4perl::Util::module_available($type)
264 0 13 unless eval "require $type"
282 0 3 unless defined $logic
299 3 184 if (exists $additivity{$name})
323 5 158 if ($CONFIG_INTEGRITY_CHECK and not config_is_sane())
338 4 150 unless ($LOGGERS_DEFINED)
343 1 149 if (scalar keys %Log::Log4perl::Logger::APPENDER_BY_NAME == 0)
364 10 194 if (ref $appenderclass) { }
367 1 193 unless $appenderclass
371 13 180 if (Log::Log4perl::JavaMap::translate($appenderclass)) { }
379 377 167 if $_ ne "layout"
393 192 5 if (exists $data->{'appender'}{$appname}{$pname}{'value'}) { }
431 0 11 if exists $appenders_created->{$appname}
450 190 11 unless $appender->composite
457 1 194 if (defined $system_wide_threshold and not defined $threshold)
462 13 182 if (defined $threshold)
471 12 183 if (defined $filtername)
474 0 12 unless defined $filter
478 3 2 if (defined $system_wide_threshold and defined $threshold and $Log::Log4perl::Level::PRIORITY{$system_wide_threshold} > $Log::Log4perl::Level::PRIORITY{$threshold})
489 1 194 if (exists $data->{'appender'}{$appname}{'threshold'})
503 2 188 unless $layout_class
508 36 152 unless (Log::Log4perl::Util::module_available($layout_class))
509 34 2 if (Log::Log4perl::Util::module_available("Log::Log4perl::Layout::$layout_class")) { }
519 0 186 unless Log::Log4perl::Util::module_available($layout_class)
532 10 194 if (exists $appenders_created->{$name}) { }
557 0 3 unless $letter =~ /^[a-zA-Z]$/
578 0 187 unless defined $config
591 2 185 if (ref $config eq 'HASH') { }
161 24 elsif (ref $config eq 'SCALAR') { }
1 23 elsif (ref $config eq 'GLOB' or ref $config eq 'IO::File') { }
1 22 elsif (ref $config) { }
0 22 elsif ($config =~ m[^ldap://]) { }
596 1 7 if (ref $config->{$key} eq "CODE")
619 0 0 unless (Log::Log4perl::Util::module_available("Net::LDAP"))
630 0 22 if ($config =~ /^(https?|ftp|wais|gopher|file):/) { }
633 0 0 unless Log::Log4perl::Util::module_available("LWP::UserAgent")
637 0 0 unless (defined $LWP_USER_AGENT)
650 0 0 if ($res->is_success) { }
668 9 175 unless (grep /\S/, @text)
672 0 175 if ($text[0] =~ /^<\?xml /) { }
674 0 0 unless Log::Log4perl::Util::module_available("XML::DOM")
730 3310 2221 if (ref $node eq 'HASH') { }
760 4 914 if (my $cref = compile_if_perl($value))
772 30 929 if ($value =~ /^\s*sub\s*{/)
774 2 28 unless ("Log::Log4perl::Config"->allow_code)
778 1 27 if (defined($mask = 'Log::Log4perl::Config'->allowed_code_ops)) { }
6 21 elsif ($mask = 'Log::Log4perl::Config'->allowed_code_ops_convenience_map('Log::Log4perl::Config'->allow_code)) { }
21 0 elsif ('Log::Log4perl::Config'->allow_code == 1) { }
789 1 20 unless my $cref = eval "package main; $value"
815 0 11 unless $safe->share_from($_, $toshare)
820 4 3 unless my $cref = $safe->reval("package main; $value")
832 17 217 if $value =~ /^true$/i
833 7 227 if $value =~ /^false$/i
844 0 28 if (defined $class and $class ne "Log::Log4perl::Config")
849 2 26 if (@args == 1 and ref $args[0] eq 'HASH') { }
12 14 elsif (@args == 1) { }
2 12 elsif (@args == 2) { }
864 1 15 wantarray ? :
875 0 29 if (defined $class and $class ne "Log::Log4perl::Config")
879 1 28 if (@args) { }
884 27 1 unless (@Log::Log4perl::ALLOWED_CODE_OPS_IN_CONFIG_FILE)
890 0 2 wantarray ? :
899 0 36 if (defined $class and $class ne "Log::Log4perl::Config")
904 2 34 if (@args == 1 and ref $args[0] eq 'HASH') { }
28 6 elsif (@args == 1) { }
1 5 elsif (@args == 2) { }
915 0 1 if (ref $args[1] ne "ARRAY")
923 1 7 wantarray ? :
933 9 83 if (defined $class and $class ne "Log::Log4perl::Config")
937 14 78 if (@args)
953 9 5 if (exists $subst_hash->{$varname}) { }
4 1 elsif (exists $ENV{$varname}) { }