Branch Coverage

blib/lib/Class/Component.pm
Criterion Covered Total %
branch 90 110 81.8


line true false branch
16 0 531 if $_[1]
23 18 20 unless $class eq 'Class::Component'
26 20 0 unless ($pkg->isa('Class::Component'))
48 7 8 if $key =~ /^$klass-/ or $key eq $klass
53 0 11 if $key =~ /^$klass\::/ or $key eq $klass
86 0 22 if defined $args{'config'}
89 2 20 if $args{'reload_plugin'}
113 2 25 if (($pkg = $component) =~ s/^\+// or $pkg = $c->class_component_load_component_resolver($component)) { }
114 0 2 unless $pkg->require
116 0 25 unless ($pkg = $class->pkg_require($c, "Component::$component"))
117 0 0 if $@
122 25 2 unless ($reload)
124 2 8 if $pkg eq $default
133 68 25 unless ($c eq $isa_pkg)
139 23 2 unless $reload
140 3 22 if $pkg->can('class_component_load_component_init')
146 19 46 unless ref $c
159 3 4 if $plugin eq $default
170 8 71 if (ref $plugin eq 'HASH')
174 0 79 unless $plugin
177 9 70 if (($pkg = $plugin) =~ s/^\+// or $pkg = $c->class_component_load_plugin_resolver($plugin)) { }
178 0 9 unless $pkg->require
180 0 70 unless ($pkg = $class->pkg_require($c, "Plugin::$plugin"))
181 0 0 if $@
187 71 8 unless ($config)
189 8 31 if $pkg eq ref $default
212 21 19 unless $$args{'load_plugins'}
227 32 6 unless $c->class_component_hooks->{$hook}
235 3 2 unless ref $c->class_component_methods->{$method} eq $plugin
246 0 2 unless ref $$obj{'plugin'} eq $$remove_obj{'plugin'} and $$obj{'method'} eq $$remove_obj{'method'}
249 2 0 unless @{$c->class_component_hooks->{$hook};}
255 19 106 unless my $plugin = $c->class_component_methods->{$method}
256 10 96 if (ref $plugin eq 'HASH') { }
261 0 10 unless $plugin and $real_method
263 4 6 if (ref $real_method eq 'CODE') { }
6 0 elsif (not ref $real_method) { }
276 9 54 unless my $hooks = $c->class_component_hooks->{$hook}
290 10 4 if 'Class::Inspector'->loaded($class->_class($pkg))
307 146 14 unless my $code = $$reload_plugin_maps{$class->_class($c)}
320 25 42 unless $pkg->can($method)
326 22 0 unless $pkg->can('AUTOLOAD')
335 9 126 if $from
336 27 108 unless $$component_isa_list{$key}
351 68 77 unless $from
353 325 249 if ($f) { }
356 172 77 unless $pkg eq $from
381 574 48 if not $$isa_mark{$pkg} or $$isa_mark{$pkg}{'nest'} < $nest
390 574 48 unless (--$$isa_mark{$pkg}{'count'})
404 46 197 unless ref $c
415 249 18 if ($isa_list = $$component_isa_list{$c})
416 181 68 if (my $cache = $$pkg_require_cache{$pkg})
417 141 40 if ($$cache{'isa_list'} eq join('-', @{$isa_list;}))
427 0 232 unless ($isa_list)
433 106 126 unless 'Class::Inspector'->installed($new_pkg)
434 0 126 unless $new_pkg->require