Condition Coverage

lib/UR/Context.pm
Criterion Covered Total %
condition 172 264 65.1


and 3 conditions

line !l l&&!r l&&r condition
109 25 0 2 defined $cache_size_highwater and $cache_size_highwater > 0
173 0 0 0 substr($subject_class, 0, 4) eq 'UR::' and $monitor_level < 2
228 0 0 1665 $params->{'data_source'} and not ref $params->{'data_source'}
0 0 1665 $params->{'data_source'} and not ref $params->{'data_source'} and $params->{'data_source'}->can('get_namespace')
0 0 0 $params->{'data_source'} and ref $params->{'data_source'} eq 'ARRAY'
441 67818 185797 0 ref $self and $self->query_underlying_context
462 8571 2920090 74888 exists $UR::Context::all_objects_loaded->{$subclass} and my $obj = $UR::Context::all_objects_loaded->{$subclass}{$_[1]}
503 0 11 0 scalar @extra == 2 and $extra[0] eq 'sql' || $extra[0] eq 'sql in'
516 16 117270 0 not $rule->has_meta_options and $class->isa('UR::Object::Type') || $class->isa('UR::Singleton') || $class->isa('UR::DataSource::QueryPlan')
523 30665 0 0 @objects > 1 and defined wantarray
598 4 0 2 $property_meta->is_calculated and ref $property_meta->calculate eq 'CODE'
4 0 0 $property_meta->is_calculated and not ref $property_meta->calculate
712 136 1103 7 $prop->data_type and $prop->_data_type_as_class_name eq $prop->data_type
1239 1 6 $prop->data_type and $prop->_data_type_as_class_name eq $prop->data_type and $prop->_data_type_as_class_name->can('get')
756 926 70 1583 $class ne $co->class_name and $co->is_abstract
996 1560 23 $class ne $co->class_name and $co->is_abstract and my $method = $co->subclassify_by
804 0 0 0 defined $sub_class_name and $sub_class_name ne $class
952 0 0 5 $indirect_property_meta and $indirect_property_meta->to
984 10 3 2 $rule->specifies_value_for($source_property_name) and $rule->value_for($source_property_name) ne $value
1027 138 0 2311 not exists $params->{$property_name} and $property_meta
138 2310 1 not exists $params->{$property_name} and $property_meta and $property_meta->is_calculated
1392 1 1 0 $cache_size_lowwater and $value <= $cache_size_lowwater
1409 1 2 0 defined $value and $cache_size_highwater
1 1 0 defined $value and $cache_size_highwater and $value >= $cache_size_highwater
1442 0 5 0 defined $cache_size_highwater and defined $cache_size_lowwater
1479 4 0 33 $all_objects_cache_size > $cache_size_lowwater and $target_serial < $GET_COUNTER
1491 0 2171 0 $obj->is_prunable and $obj->{'__get_serial'}
139 1747 285 $obj->is_prunable and $obj->{'__get_serial'} and $obj->{'__get_serial'} <= $target_serial
1551 0 0 0 $i < 10 and $i < @sorted_counts
1697 149723 44427 149923 ref $self and not defined $load
1701 344043 28 2 $group_by and $rule_template->order_by
1710 343635 397 40 $cache_size_highwater and $all_objects_cache_size > $cache_size_highwater
1733 343983 45 35 $subclassify_by and not $meta->is_abstract
344028 0 35 $subclassify_by and not $meta->is_abstract and not $rule->template->group_by
45 0 35 $subclassify_by and not $meta->is_abstract and not $rule->template->group_by and not $rule->specifies_value_for($subclassify_by)
1778 340160 1877 2026 $ds and $load
342037 1926 100 $ds and $load and $rule_template->order_by
1931 0 0 23 defined $existing_object and $self->object_exists_in_underlying_context($existing_object)
0 21 2 defined $existing_object and $self->object_exists_in_underlying_context($existing_object) and $existing_object->__changes__
2052 0 0 4 defined $id_list and @$id_list
2075 3664 29 33 ref $id and ref $id eq 'HASH'
2272 96527 136422 45653 not $UR::Object::Type::bootstrapping and $class eq 'UR::Object::Type'
2338 19147 95199 0 $prop_meta and $prop_meta->is_many || $prop_meta->is_delegated
2529 1581 409 0 exists $$all_params_loaded{$template->id} and exists $$all_params_loaded{$template->id}{$rule->id}
3069 0 0 0 scalar @extra == 2 and $extra[0] eq 'sql' || $extra[0] eq 'sql in'

or 2 conditions

line l !l condition
62 0 266 $ENV{'UR_CONTEXT_ROOT'} ||= 'UR::Context::DefaultRoot'
81 0 0 $ENV{'UR_CONTEXT_CACHE_SIZE_HIGHWATER'} || 0
82 0 0 $ENV{'UR_CONTEXT_CACHE_SIZE_LOWWATER'} || 0
1452 0 4 'UR::Object::Index'->__meta__->composite_id_separator || "\t"
1486 181 17 $indexes_by_class{$class} ||= []
1530 275 27 $indexes_by_class{$class} ||= ['UR::Object::Index'->get('indexed_class_name', $class)]
1915 10 6 $tmpl->offset || 0
2266 0 0 $id ||= ''
2823 91 56 $ds_objects{$data_source_id} ||= {'ds_obj', $data_source, 'changed_objects', []}

or 3 conditions

line l !l&&r !l&&!r condition
80 0 0 266 exists $ENV{'UR_CONTEXT_CACHE_SIZE_LOWWATER'} or exists $ENV{'UR_CONTEXT_CACHE_SIZE_HIGHWATER'}
109 2 0 25 defined $cache_size_highwater and $cache_size_highwater > 0 or $light_cache
0 12 13 defined $cache_size_highwater and $cache_size_highwater > 0 or $light_cache or 'UR::Context::AutoUnloadPool'->_pool_count
286 32 0 540 $class_name->isa('UR::DataSource::RDBMS::Entity') or $class_name->isa('UR::DataSource::RDBMS::Entity::Ghost')
365 252 98478 968 $property eq 'create' or $property eq 'load'
98730 0 968 $property eq 'create' or $property eq 'load' or $property eq 'define'
374 123 778 98797 $property eq 'delete' or $property eq 'unload'
441 0 0 253615 ref $self and $self->query_underlying_context or &Scalar::Util::blessed($_[1])
503 6 2 3 $extra[0] eq 'sql' || $extra[0] eq 'sql in'
516 53086 3838 60346 $class->isa('UR::Object::Type') || $class->isa('UR::Singleton') || $class->isa('UR::DataSource::QueryPlan')
1175 73 0 599 $entity->{'db_committed'} or $entity->{'db_saved_uncommitted'}
1290 5 4 0 $property_meta->final_property_meta || $property_meta
1447 0 0 4 $ENV{'UR_DEBUG_OBJECT_RELEASE'} or $ENV{'UR_DEBUG_OBJECT_PRUNING'}
1491 2 0 2171 $obj->is_weakened or $obj->is_prunable and $obj->{'__get_serial'} and $obj->{'__get_serial'} <= $target_serial
1508 0 0 4 $ENV{'UR_DEBUG_OBJECT_RELEASE'} or $ENV{'UR_DEBUG_OBJECT_PRUNING'}
1599 8 0 321 $obj->{'db_saved_uncommitted'} || $obj->{'db_committed'}
1614 105 0 54 exists $obj->{'db_committed'} || exists $obj->{'db_saved_uncommitted'}
1626 2 0 16 wantarray or not defined wantarray
1746 269320 163 74580 not defined $load or $load
1748 265580 14 3889 not $ds or $class =~ /::Ghost$/
1793 2023 0 342040 $load or $return_closure
1813 7 6 342002 defined $normalized_rule_template->limit or defined $normalized_rule_template->offset
1864 3 0 22 defined $normalized_rule_template->limit or defined $normalized_rule_template->offset
1881 0 0 0 defined $normalized_rule_template->limit or defined $normalized_rule_template->offset
1976 3617 23 37 $object_value eq $db_value or $object_value eq $expected_db_value
3640 25 12 $object_value eq $db_value or $object_value eq $expected_db_value or $db_value eq $expected_db_value
2169 1165 130 1860 exists $UR::Context::all_params_loaded->{$template_id} && exists $UR::Context::all_params_loaded->{$template_id}{$rule_id} || $self->_loading_was_done_before_with_a_superset_of_this_rule($normalized_rule)
2176 1295 5 1855 $loading_was_done_before_with_these_params || $class->all_objects_are_loaded
2276 24331 0 21322 $UR::Context::all_objects_loaded->{$meta_class_name}{$id} || $UR::Context::all_objects_loaded->{'UR::Object::Type'}{$id}
2326 224 0 114373 substr($key, 0, 1) eq '-' or substr($key, 0, 1) eq '_'
2338 34 87 95078 $prop_meta->is_many || $prop_meta->is_delegated
2364 63658 1070 0 $index ||= 'UR::Object::Index'->create('id', $index_id, 'indexed_class_name', $class, 'indexed_property_string', $pstring)
2708 0 0 215 $local_dont_unload{$class_name} or grep {$class_name->isa($_);} @{$args{'dont_unload'};}
2723 0 0 18 $local_dont_unload{$obj_type} or grep {$obj_type->isa($_);} @{$args{'dont_unload'};}
2765 60 9 130 $is_default{$a->id} <=> $is_default{$b->id} or $can_savepoint{$a->id} <=> $can_savepoint{$b->id}
2876 4 0 0 eval { do { $obj->__display_name__ } } || $obj->id
3069 0 0 0 $extra[0] eq 'sql' || $extra[0] eq 'sql in'