Branch Coverage

lib/App/Context.pm
Criterion Covered Total %
branch 149 828 18.0


line true false branch
191 0 6 if $App::trace
198 6 0 if ($#_ > -1)
199 6 0 if (ref $_[0] eq 'HASH') { }
201 0 6 if $#_ % 2 == 0
208 0 0 $#_ > -1 ? :
224 0 6 if (defined $debug and $debug ne '')
225 0 0 if ($debug =~ s/^([0-9]+),?//)
228 0 0 if ($debug)
240 6 0 unless defined $$self{'log_level'}
244 6 0 unless $conf_class
246 0 6 if ($App::DEBUG >= 2)
267 0 20 if ($var =~ /^app\.(.+)/)
272 0 6 if $@
280 0 6 if $$conf{'global'}
281 0 6 if ($includes and ref $includes eq 'ARRAY')
289 0 0 if ($matches)
290 0 0 if (ref $include_files eq 'ARRAY') { }
0 0 elsif (ref $include_files eq '') { }
297 0 0 unless $conf_file =~ m[^/]
298 0 0 if ($$self{'conf_included'}{$conf_file})
299 0 0 if $options{'debug_conf'}
302 0 0 if (-r $conf_file) { }
306 0 0 if $options{'debug_conf'}
309 0 0 if $options{'debug_conf'}
314 0 0 if not $matches and $options{'debug_conf'}
321 0 6 if (defined $options{'debug_conf'} and $options{'debug_conf'} >= 2)
337 0 6 if ($options{'authentication_class'})
341 0 6 if $App::trace
346 0 5 if $App::trace
347 0 5 if $App::trace
354 0 0 if $App::trace
360 0 0 if ($cond =~ /^([^=]+)=(.*)$/) { }
368 0 0 if ($cond_value =~ m[^/(.*)/$]) { }
0 0 elsif ($var eq 'app' and $cond_value eq '' || $cond_value eq 'ALL') { }
371 0 0 unless defined $value
372 0 0 $value =~ /$regexp/ ? :
379 0 0 unless defined $value
380 0 0 $value eq $cond_value ? :
382 0 0 unless $matches
384 0 0 if $App::trace
423 0 5 if $App::trace
428 0 5 if $App::trace
532 0 26 if $App::trace
534 0 26 if $App::DEBUG and $self->dbg(3)
544 0 26 unless (defined $type)
550 4 22 if (%named) { }
557 1 25 if (not defined $name or $name eq '')
572 9 0 unless ($service_initialized or $service_conf or $name =~ /-/)
576 0 9 if (not $$self{'conf_included'}{$conf_file} and -r $conf_file)
588 0 17 if (not $service_initialized and $service_conf and $$service_conf{'include'})
592 0 0 if (ref $include_files eq 'ARRAY') { }
0 0 elsif (ref $include_files eq '') { }
599 0 0 unless $conf_file =~ m[^/]
600 0 0 if $$self{'conf_included'}{$conf_file}
601 0 0 if (-r $conf_file)
613 8 18 if (not $service_initialized and $service_conf)
614 0 8 if ($$service_conf{'deprecated'})
617 0 0 if $message_suffix ne '1'
619 0 0 if (not $deprecated_action or $deprecated_action eq 'none') { }
0 0 elsif ($deprecated_action eq 'die') { }
634 8 18 if (not $service_initialized and $service_conf)
636 0 8 if ($alias and $alias ne $name) { }
0 8 elsif ($type ne 'Authorization' and $$service_conf{'clone'} || $$service_conf{'auth_clone'}) { }
638 0 0 unless $service
644 0 0 if ($clone)
653 13 9 if ($temporary or not defined $service or ref $service eq 'HASH')
654 12 5 unless defined $service
659 4 13 if ($temporary)
664 0 17 if ($App::DEBUG and $self->dbg(6))
666 0 0 if $service_conf
667 0 0 if $service_store
675 6 11 if ($service_store)
677 1 1 unless (defined $$service{$attrib})
686 8 9 if ($service_conf)
689 10 0 unless (defined $$service{$attrib})
699 0 17 if ($service_type)
701 0 0 if ($service_type_conf)
704 0 0 unless (defined $$service{$attrib})
728 4 22 if ($temporary) { }
0 22 elsif (defined $$args{'lightweight'}) { }
739 17 9 if ($new_service or $override)
742 0 4 if $attrib eq 'override'
745 2 2 if (not defined $$service{$attrib} or $override and $$service{$attrib} ne $$args{$attrib})
748 2 0 unless $lightweight
750 0 4 if $App::DEBUG and $self->dbg(6)
758 17 9 if ($new_service)
759 0 17 if $App::DEBUG and $self->dbg(3)
762 0 17 if (not $temporary and defined $$service{'default'})
764 0 0 if ($default =~ /^\{today\}\+?(-?[0-9]+)?$/)
765 0 0 $1 ? :
767 0 0 if (defined $default)
775 7 10 if (not defined $class or $class eq '')
780 10 7 unless ($$self{'used'}{$class})
784 0 16 if $App::DEBUG and $self->dbg(3)
788 12 4 unless ($temporary)
794 0 25 if $App::DEBUG and $self->dbg(3)
797 0 25 if $App::trace
861 4 0 if ($#_ > -1 or not $name or $self->service_exists('Serializer', $name)) { }
880 0 0 if ($$options{$key})
888 0 0 if ($#args <= 0)
933 0 0 if $App::trace
942 0 0 unless ($session_object_class)
949 0 0 if ($session_object_type)
954 0 0 $session_object_class ? :
956 0 0 if $App::DEBUG and $self->dbg(2)
959 0 0 if $App::trace
964 0 4 if $App::trace
973 0 4 unless ($service_class)
980 0 0 if ($service_template)
985 4 0 $service_class ? :
987 0 4 if $App::DEBUG and $self->dbg(2)
990 0 4 if $App::trace
1029 0 1 if $App::trace
1032 1 0 unless defined $value
1033 0 1 if $App::trace
1061 0 0 if $App::trace
1064 0 0 unless defined $value
1065 0 0 if $App::trace
1100 0 0 if ($auth_value_list and ref $auth_value_list eq 'ARRAY')
1105 0 0 if ($auth_name =~ m[^/]) { }
1111 0 0 if ($auth->is_authorized($auth_key))
1117 0 0 unless ($auth_value)
1150 0 5 if $App::trace
1154 4 1 if (not defined $var or $var eq '')
1155 0 4 if ($name =~ /^([a-zA-Z0-9_\.-]+)([\{\}\[\]].*)$/) { }
1 3 elsif ($name =~ /^([a-zA-Z0-9_\.-]+)-([a-zA-Z0-9_]+)$/) { }
1169 5 0 if (not $var =~ /[\[\]\{\}]/) { }
0 0 elsif ($var =~ /^\{([^\{\}]+)\}$/) { }
0 0 elsif ($var =~ /^[\{\}\[\]].*$/) { }
1171 1 4 if (not defined $cached_service or ref $cached_service eq 'HASH')
1175 0 5 if (!defined($value) || $value eq '' and defined $default)
1177 0 0 if ($setdefault)
1182 0 5 if $App::DEBUG and $self->dbg(3)
1188 0 0 if (not defined $value and defined $default)
1190 0 0 if ($setdefault)
1193 0 0 if (not defined $cached_service or ref $cached_service eq 'HASH')
1199 0 0 if $App::DEBUG and $self->dbg(3)
1204 0 0 unless defined $$self{'session'}{'cache'}{'SessionObject'}{$name}
1209 0 0 if $@
1212 0 0 if $App::DEBUG and $self->dbg(3)
1215 0 5 if $App::trace
1223 0 0 if $App::trace
1227 0 0 unless (defined $value)
1229 0 0 unless (defined $value)
1234 0 0 if $App::trace
1264 0 3 if $App::trace
1269 0 3 if ($value eq '{:delete:}') { }
1273 0 3 if $App::DEBUG and $self->dbg(3)
1276 3 0 if (not defined $var or $var eq '')
1277 0 3 if ($name =~ /^([a-zA-Z0-9_\.-]+)([\{\}\[\]].*)$/) { }
0 3 elsif ($name =~ /^([a-zA-Z0-9_\.-]+)-([a-zA-Z0-9_]+)$/) { }
1291 3 0 if (not $var =~ /[\[\]\{\}]/) { }
0 0 elsif ($var =~ /^\{([^\}]+)\}$/) { }
0 0 elsif ($var =~ /^\{/) { }
1313 0 0 if defined $$self{'session'}{'cache'}{'SessionObject'}{$name}
1317 0 0 if ($@) { }
1329 0 3 if $App::trace
1357 0 0 if $App::trace
1360 0 0 if $App::trace
1388 0 0 if $App::trace
1392 0 0 if $App::DEBUG and $self->dbg(3)
1395 0 0 if (not defined $var or $var eq '')
1396 0 0 if ($name =~ /^([a-zA-Z0-9_\.-]+)([\{\}\[\]].*)$/) { }
0 0 elsif ($name =~ /^([a-zA-Z0-9_\.-]+)-([a-zA-Z0-9_]+)$/) { }
1410 0 0 if (not $var =~ /[\[\]\{\}]/) { }
0 0 elsif ($var =~ /^\{([^\}]+)\}$/) { }
0 0 elsif ($var =~ /^\{/) { }
1412 0 0 if defined $$self{'session'}{'cache'}{'SessionObject'}{$name}
1418 0 0 if defined $$self{'session'}{'cache'}{'SessionObject'}{$name}
1428 0 0 if defined $$self{'session'}{'cache'}{'SessionObject'}{$name}
1432 0 0 if $@
1436 0 0 if $App::trace
1464 0 0 if $App::trace
1466 0 0 if $App::DEBUG and $self->dbg(1)
1469 0 0 unless defined $values
1471 0 0 if (ref $text eq 'HASH')
1485 0 0 if (defined $$values{$var}) { }
1490 0 0 if ($var =~ /^(.+)\.([^.]+)$/) { }
1492 0 0 if (defined $value) { }
1504 0 0 if ($phrase eq '') { }
1513 0 0 if (defined $$values{$var}) { }
1519 0 0 if ($var =~ /^(.+)\.([^.]+)$/)
1523 0 0 unless defined $value
1527 0 0 if $App::trace
1561 0 0 if $App::trace
1564 0 0 if (defined $$self{'messages'}) { }
1570 0 0 if $App::trace
1574 0 0 if $App::trace
1577 0 0 if $msgs
1578 0 0 if $App::trace
1652 0 4 if $App::trace
1655 4 0 if $#_ > -1 and ref $_[0] eq 'HASH'
1658 4 0 unless defined $log_level
1659 0 4 if (not defined $log_level or $msg_level <= $log_level)
1662 0 4 if $App::trace
1666 0 0 if $App::trace
1671 0 0 if ($hi_res) { }
1675 0 0 if ($elapsed)
1676 0 0 unless (defined $$self{'_last_log_elapsed_time'})
1687 0 0 if ($elapsed)
1693 0 0 if ($#_ > 0) { }
0 0 elsif ($#_ == 0) { }
1700 0 0 if $App::trace
1706 0 6 if $App::trace
1709 0 6 if ($log_file)
1710 0 0 if ($$self{'log_fh'})
1714 0 0 if ($log_file =~ /%/)
1717 0 0 if (defined $overwrite and $overwrite or not defined $overwrite and $$self{'options'}{'log_overwrite'}) { }
1718 0 0 unless open LOG, "> $log_file"
1721 0 0 unless open LOG, ">> $log_file"
1730 0 6 if $App::trace
1755 0 0 if $App::trace
1758 0 0 if $App::trace
1763 0 0 if $App::trace
1766 0 0 if $App::trace
1791 0 0 if $App::trace
1794 0 0 if $App::trace
1819 0 2 if $App::trace
1821 0 2 if $App::trace
1850 0 7 if $App::trace
1853 1 6 if not defined $session_id or $session_id eq ''
1855 6 1 unless ($session)
1860 0 6 if $App::DEBUG and $self->dbg(1)
1862 0 6 if (defined $args) { }
1873 0 6 if $@
1875 0 7 if $App::trace
1888 0 6 if $App::trace
1890 6 0 if not defined $session_id or $session_id ne ''
1892 0 6 if $App::trace
1896 0 0 if $App::trace
1899 0 0 if $App::trace
1903 0 0 if $App::trace
1905 0 0 if not defined $session_id or $session_id ne ''
1907 0 0 if ($#service_types == -1)
1916 0 0 unless ($service_type_seen{$service_type})
1923 0 0 if ($service_type ne 'SessionObject') { }
1931 0 0 if ($services)
1933 0 0 if $so_name ne 'default'
1937 0 0 if ($services)
1939 0 0 if $so_name ne 'default'
1943 0 0 if ($default_session_object)
1945 0 0 unless $attrib =~ /^$special_attrib$/
1949 0 0 if ($default_session_object)
1951 0 0 unless $attrib =~ /^$special_attrib$/
1964 0 0 if $App::trace
1976 0 0 if $App::trace
1985 0 0 if $App::trace
1990 0 0 if $App::trace
1999 0 0 if $$event{'args'}
2014 0 0 if $args
2019 0 0 if $App::trace
2064 0 0 unless $App::DEBUG
2065 0 0 unless defined $level
2066 0 0 if defined $level and $App::DEBUG < $level
2069 0 0 ref $self eq '' ? :
2076 0 0 unless defined $debug_scope
2077 0 0 unless %$debug_scope
2078 0 0 if defined $$debug_scope{$package}
2079 0 0 if defined $$debug_scope{$subroutine}
2108 0 0 if (defined $App::options{'debug_file'}) { }
2144 0 0 if defined $dbglevel
2177 0 0 unless (defined $debug_scope)
2248 0 0 if $App::trace
2266 0 0 if ($show_current_session_object)
2270 0 0 if ($show_current_session_object and $type and $name)
2276 0 0 if ($@)
2280 0 0 if ($$self{'options'}{'debug_context'})
2285 0 0 if $App::trace
2289 0 0 if $App::trace
2291 0 0 if $App::trace
2295 0 0 if $App::trace
2298 0 0 if $App::trace
2302 0 0 if $App::trace
2304 0 0 unless $args
2306 0 0 if $App::trace
2310 0 0 if $App::trace
2314 0 0 if ($service_type eq 'Context') { }
2321 0 0 if (not $service) { }
0 0 elsif (not $service->isa('App::Widget') and $method and $service->can($method)) { }
0 0 elsif ($service->can('handle_event')) { }
2325 0 0 ref $args eq 'ARRAY' ? :
2327 0 0 if ($#results == -1) { }
0 0 elsif ($#results == 0) { }
2338 0 0 ref $args eq 'ARRAY' ? :
2342 0 0 if ($method eq 'contents') { }
2349 0 0 if $App::trace
2372 0 0 if $App::trace
2377 0 0 if (ref $results)
2383 0 0 if ($$self{'messages'}) { }
2392 0 0 if $App::trace
2396 0 0 if $App::trace
2409 0 0 if $App::trace
2427 0 0 if $App::trace
2434 0 0 unless (defined $event{'time'})
2436 0 0 if $event{'interval'}
2440 0 0 if (defined $event{'scheduled'})
2445 0 0 unless $event{'tag'} or $event{'method'}
2449 0 0 if ($event{'tag'})
2452 0 0 if ($event) { }
2458 0 0 if $event{'tag'}
2462 0 0 if ($$event{'scheduled'}) { }
2463 0 0 if ($unschedule and $$event{'tag'})
2466 0 0 if ($$scheduled_events[$i]{'tag'} eq $$event{'tag'})
2475 0 0 unless ($unschedule)
2481 0 0 if $App::trace
2485 0 0 if $App::trace
2487 0 0 unless $time
2499 0 0 if ($$event{'time'} <= $time) { }
2501 0 0 if ($$event{'time'} and $$event{'interval'}) { }
2504 0 0 if ($time_of_next_event == 0 or $$event{'time'} < $time_of_next_event)
2515 0 0 if ($time_of_next_event == 0 or $$event{'time'} < $time_of_next_event)
2520 0 0 if $App::trace
2526 0 4 if $App::trace
2529 2 2 $$event{'args'} ? :
2532 0 4 if not $service_type and $name
2534 3 1 if ($name) { }
2543 0 4 if $App::trace
2544 0 4 if (wantarray) { }
2548 0 4 if ($#results == -1) { }
4 0 elsif ($#results == 0) { }
2570 0 1 if $App::trace
2573 0 1 if $App::trace
2578 0 1 if $App::trace
2587 0 1 if ($@)
2592 1 0 if ($callback_event)
2593 1 0 unless $$callback_event{'args'}
2597 0 1 if $App::trace
2619 0 0 if $App::trace
2621 0 0 if $App::trace
2628 0 0 if $App::trace
2631 0 0 unless ($pid)
2635 0 0 if $App::trace
2649 0 0 if $App::trace
2653 0 0 if (not $port and $host =~ /^([^:]+):([0-9]+)$/)
2666 0 0 if $send_socket
2670 0 0 $await_return_value ? :
2671 0 0 $server_close ? :
2672 0 0 if ($send_socket) { }
2674 0 0 if $await_return_value or $server_close
2676 0 0 if ($await_return_value or $server_close)
2680 0 0 if $await_return_value and not $server_close
2684 0 0 if ($@)
2693 0 0 if $App::trace
2724 0 0 if $App::trace
2727 0 0 if (not $pid) { }
2734 0 0 if $App::trace
2779 0 0 if $App::DEBUG and $self->dbg(1)
2783 0 0 if (defined $repcache and ref $repcache eq 'HASH')
2818 1 0 if (not $$self{'shutdown_complete'})
2821 0 1 if ($profiler)
2826 0 1 if $App::DEBUG and $self->dbg(1)
2830 0 1 if (defined $repcache and ref $repcache eq 'HASH')
2834 0 0 if $App::DEBUG and $self->dbg(1)
2871 0 0 if $App::trace
2875 0 0 unless (defined $response)
2887 0 0 if $@
2890 0 0 if $App::trace
2899 0 5 if $App::trace
2903 0 5 if ($profiler)
2907 0 5 if $App::trace
2911 0 0 if $App::trace
2915 0 0 unless ($profile_state)
2927 0 0 if ($events and $#$events > -1)
2931 0 0 if ($$event[3] and $#{$$event[3];} > -1)
2943 0 0 $repname ? :
2945 0 0 if ($rep) { }
2947 0 0 unless ($$profile_state{'profiler_log_id'})
2960 0 0 if $App::trace
2964 0 0 if $App::trace
2969 0 0 $repname ? :
2974 0 0 if (defined $app_scope) { }
0 0 elsif (defined $$profile_state{'app_scope'}) { }
2981 0 0 if (defined $app_scope_id) { }
0 0 elsif (defined $$profile_state{'app_scope_id'}) { }
2990 0 0 if (defined $content_name) { }
0 0 elsif (defined $$profile_state{'content_name'}) { }
2997 0 0 if ($rep) { }
2998 0 0 if ($profiler_log_id)
3010 0 0 if $App::trace
3014 0 0 if $App::trace
3038 0 0 $run_aux1_label ? :
3039 0 0 $run_aux2_label ? :
3051 0 0 if $run_other_time < 1e-06
3055 0 0 $repname ? :
3057 0 0 if ($rep) { }
3058 0 0 if ($profiler_log_id)
3084 0 0 if ($run_aux1_label)
3088 0 0 if ($run_aux2_label)
3098 0 0 if $App::trace
3119 0 0 unless ($profile_state)
3130 0 0 unless ($profile_stats)
3138 0 0 $#$key_stack > -1 ? :
3139 0 0 if ($last_key)
3143 0 0 if ($#$key_stack > 100)
3146 0 0 if (not $replace or $#$key_stack == -1) { }
3160 0 0 if ($profile_state and $profile_stats)
3164 0 0 $#$key_stack > -1 ? :
3171 0 0 if $last_key eq $key
3180 0 0 if (not defined $stats) { }
3192 0 0 if ($key_started) { }
3195 0 0 if ($sample_time > 0)
3196 0 0 if $sample_time < $$stats{'min_time'}
3197 0 0 if $sample_time > $$stats{'max_time'}
3211 0 0 if ($profile_state)
3242 0 0 if ($$stats{'count'})
3290 0 0 if (open FILE, '/proc/meminfo')
3292 0 0 if (/^([A-Za-z]+):\s*([0-9]+)/)
3300 0 0 if (open FILE, '/proc/loadavg')
3302 0 0 if (m[^([0-9.]+)\s+([0-9.]+)\s+([0-9.]+)\s+([0-9]+)/([0-9]+)\s+([0-9]+)])
3345 0 0 if $#pids == -1
3352 0 0 if (open FILE, "/proc/$$/status") { }
3354 0 0 if (/^Vm([A-Za-z]+):\s*([0-9]+)/)
3411 0 0 if $#pids == -1
3418 0 0 if (open FILE, "/proc/$$/stat") { }