Branch Coverage

blib/lib/Config/Model.pm
Criterion Covered Total %
branch 247 392 63.0


line true false branch
180 0 41 if (ref $args[0])
196 0 39 $log4perl_syst_conf_file->is_file ? :
0 39 $log4perl_user_conf_file->is_file ? :
2 39 $force_default_log ? :
206 2 39 if (defined $verbose)
207 1 1 ref $verbose ? :
221 39 33 unless "Log::Log4perl"->initialized
230 0 1 ref $ref ? :
232 0 1 if ($behavior eq 'die') { }
1 0 elsif ($behavior eq 'warn') { }
0 0 elsif ($behavior eq 'note') { }
248 46 95 if (defined $application)
252 5 41 unless ($args->{'root_class_name'})
265 0 141 if ($cat eq "application")
279 3 2 @args == 1 ? :
281 1 4 if (my $force = delete $args{'force-load'})
282 1 0 if $force
295 0 136 @args == 1 ? :
300 4 132 if ($args{'name'} and $self->has_instance($args{'name'}))
305 0 132 unless $args{'root_class_name'}
307 15 117 if (defined $args{'model_file'})
353 0 96 unless my $config_class_name = delete $raw_model{'name'}
357 0 96 if ($self->model_exists($config_class_name))
379 0 245 if ($self->skip_include and defined $normalized_model->{'include'}) { }
381 0 0 ref $inc ? :
383 0 0 if defined $normalized_model->{'include_after'}
391 0 244 if ($self->skip_include and defined $normalized_model->{'include_backend'}) { }
393 0 0 ref $inc ? :
410 243 1 unless defined $included_classes
418 0 4 if ($target_model->{$rw} and $included_model->{$rw}) { }
1 3 elsif ($included_model->{$rw}) { }
440 0 376 if (defined $raw_name and $config_class_name ne $raw_name)
448 44 332 unless $normalized_model->{'element'}
453 342 895 ref $item ? :
456 0 376 if (defined $normalized_model->{'inherit_after'})
461 0 376 if (defined $normalized_model->{'inherit'})
468 4539 349 unless defined $normalized_model->{$info}
483 0 46 if (ref $name_match)
484 0 0 defined $name_match->{'name_match'} ? :
502 0 376 if (@extra)
514 1479 401 unless defined $raw_compact_info
516 0 401 unless ref $raw_compact_info eq "ARRAY"
524 364 960 ref $item ? :
527 1237 87 if ($info_name eq 'element') { }
87 0 elsif ($info_name =~ /description|level|summary|status/u) { }
544 1 150 unless defined $model->{'element'}{$_}
557 0 375 if keys %$normalized_model
573 0 1842 if (delete $model->{'permission'})
576 0 1842 if (delete $model->{'experience'})
591 116 1121 if (defined $info->{'warp'})
597 2 304 if (defined $info->{'cargo'} and defined $info->{'cargo'}{'type'} and $info->{'cargo'}{'type'} eq "warped_node")
603 3 1234 if (defined $info->{'cargo'} and defined $info->{'cargo'}{'warp'})
612 32 1205 if (defined $info->{'compute'})
616 2 1235 if (defined $info->{'cargo'} and defined $info->{'cargo'}{'compute'})
623 55 1182 if (defined $info->{'refer_to'})
627 3 1234 if (defined $info->{'cargo'} and defined $info->{'cargo'}{'refer_to'})
635 306 927 if (defined $info->{'type'} and $info->{'type'} eq 'list' || $info->{'type'} eq 'hash')
637 0 306 if (defined $info->{'default'})
640 0 306 if (defined $info->{'auto_create'})
645 6 300 if (defined $info->{'warp'})
651 12 0 unless defined $rule_effect->{'default'}
658 681 556 if (defined $info->{'type'} and $info->{'type'} eq "leaf")
662 63 1174 if (defined $info->{'type'} and $info->{'type'} eq "check_list")
667 0 1237 if $legacy_logger->is_debug
678 0 752 if ($ref and ref $ref eq "ARRAY")
679 0 0 if (@$ref == 1) { }
0 0 elsif (@$ref > 1) { }
689 0 376 if ($model->{'read_config'})
695 0 376 if ($model->{'write_config'})
705 0 105 unless $ref->{'backend'}
707 0 105 if ($ref->{'backend'} eq "custom")
713 1 104 if ($ref->{'backend'} =~ /^(perl|ini|cds)$/u)
719 0 105 if (defined $ref->{'allow_empty'})
733 1237 0 unless defined $c_type
737 0 0 if (defined $info->{'cargo_args'})
745 0 0 if (defined $info->{'config_class_name'})
755 0 0 if $legacy_logger->is_debug
775 0 954 if (defined $info->{$from})
791 0 34 if (defined $info->{'allow_compute_override'})
808 0 92 if (ref $info->{$old_name} eq "ARRAY")
810 0 0 if $legacy_logger->is_debug
820 0 0 if ref $var{$_}
833 0 0 if defined $replace_h
837 0 0 if $legacy_logger->is_debug
850 0 306 if $legacy_logger->is_debug
857 0 306 if ($class_overide)
866 0 306 if $legacy_logger->is_debug
879 0 0 if $legacy_logger->is_debug
888 0 0 if (ref $def_info eq 'HASH') { }
0 0 elsif (ref $def_info eq 'ARRAY') { }
901 0 0 if $legacy_logger->is_debug
915 0 0 if $legacy_logger->is_debug
924 0 0 if ($info->{'type'} eq 'hash') { }
0 0 elsif ($info->{'type'} eq 'list') { }
926 0 0 ref $ac_info eq 'ARRAY' ? :
937 0 0 if $legacy_logger->is_debug
951 623 13 unless defined $info->{$bad}
953 0 13 if $legacy_logger->is_debug
968 0 1239 if $legacy_logger->is_debug
976 2478 0 unless $info->{$parm}
977 0 0 if defined $elt_type and $elt_type ne "warped_node"
986 0 1239 if $legacy_logger->is_debug
996 0 119 if $legacy_logger->is_debug
1006 12 107 @warper_items > 1 ? :
1015 0 119 if $legacy_logger->is_debug
1031 22 9 ref $key_set ? :
1034 0 31 if (@keys != @$warper_items and not $key_set =~ /\$\w+/u)
1055 1 66 if (ref $key) { }
57 9 elsif (not $key =~ /\$\w+/u) { }
1078 21 98 if (ref $raw_follow eq 'HASH') { }
5 93 elsif (ref $raw_follow eq 'ARRAY') { }
90 3 elsif (defined $raw_follow) { }
1104 12 107 @$warper_items > 1 ? :
1114 35 84 if (ref $raw_rules eq 'HASH') { }
84 0 elsif (ref $raw_rules eq 'ARRAY') { }
0 0 elsif (defined $raw_rules) { }
1119 35 0 $follow ? :
1122 12 72 if ($multi_follow) { }
1133 2 150 ref $key_set ? :
1134 36 115 /\$/u ? :
149 3 $follow ? :
1147 1 229 unless ref $rules[$idx] eq "HASH"
1149 140 89 unless defined $type and $type eq "leaf"
1160 770 0 unless defined $raw_builtin_default
1162 0 0 if $legacy_logger->is_debug
1171 0 0 if $legacy_logger->is_debug
1180 63 0 unless defined $raw_builtin_default
1182 0 0 if $legacy_logger->is_debug
1191 0 0 if $legacy_logger->is_debug
1203 181 64 unless defined $include_class
1207 6 58 ref $include_class ? :
1226 0 65 if (defined $include_class and defined $self->{'included_class'}{$class_name}{$include_class})
1243 24 41 if (defined $include_after and defined $included_model->{'element'})
1247 0 24 unless (defined $elt_idx{$include_after})
1265 110 1 if (not defined $target_element->{$included_elt}) { }
1283 0 0 if $path_load_file->exists
1293 1 49 if ($load_file and $load_file =~ m[^/]u) { }
0 49 elsif ($self->model_dir and $self->model_dir =~ m[^/]u) { }
1300 0 0 unless $path_load_file
1307 19 56 if ($load_file) { }
1315 29 139 if $path_load_file->exists
1318 48 27 if $path_load_file->exists
1322 0 50 unless $path_load_file
1344 1 3002 if ($snippet_dir->is_dir)
1348 0 1 unless $snippet_file =~ /\.pl$/u
1360 0 1 if $done{$done_key}
1409 1 1 unless $models_by_name{$class_to_merge}
1426 147 0 ref $config_class_info eq 'ARRAY' ? :
128 147 ref $config_class_info eq 'HASH' ? :
1431 0 275 unless my $config_class_name = $data{'name'}
1450 50 1 $model ? :
1451 0 1 if ($@) { }
1 0 elsif (not defined $model) { }
1459 1 50 if $err_msg
1482 0 6 unless defined $orig_model
1494 76 7 unless $seen{$elt}
1510 30 3532 unless $self->normalized_model_exists($config_class_name)
1513 245 3316 unless ($self->model_defined($config_class_name))
1541 2 1 unless (defined $self->normalized_model($top_class_name))
1543 1 1 if ($@)
1545 1 0 if ($e->isa('Config::Model::Exception::ModelDeclaration')) { }
1561 8 10 if $done->{$class_name}
1592 2 8 if defined $class_desc
1603 16 134 if (my $ccn = $_->{'config_class_name'})
1607 0 150 if (my $migr = $_->{'migrate_from'})
1610 0 150 if (my $migr = $_->{'migrate_values_from'})
1613 0 150 if (my $comp = $_->{'compute'})
1621 6 24 if $item
1626 24 6 unless $legalese{$what}
24 6 unless @{[] unless $legalese{$what};}
1628 2 4 ref $_ ? :
1661 0 0 if ($mform =~ /\n/u) { }
1666 0 0 if (my $rep = $migr->{'replace'})
1685 16 59 if defined $cargo_type
1688 16 59 if $ccn
1691 6 69 if ($desc)
1692 6 0 if $desc =~ /\w$/u
1693 6 0 unless $desc =~ /\s$/u
1696 0 75 if (my $status = $elt_info->{'status'})
1700 2 73 $elt_info->{'mandatory'} ? :
1706 63 12 unless defined $item
1714 139 11 unless defined $item
1723 11 64 if (@default_info)
1737 73 2 unless defined $help
1753 1 0 if (defined $dir_str and $dir_str) { }
1756 0 5 unless $dir->exists
1760 1 4 unless $pl_file->parent->exists
1764 0 5 if ($pod_file->exists)
1767 5 0 if ($old ne $res->{$class_name})
1804 0 0 unless defined $self->normalized_model($config_class_name)
1817 0 104 if (delete $args{'for'})
1830 535 7 if $l ne "hidden"
1833 104 0 wantarray ? :
1847 52 844 unless (defined $model->{'element'}{$elt})
1850 52 58 if $elt =~ /^$acc_re$/u
1879 1 6 unless defined $elts and @$elts