Branch Coverage

lib/UR/DataSource/File.pm
Criterion Covered Total %
branch 213 362 58.8


line true false branch
60 0 375 if ($ENV{'UR_DBI_MONITOR_SQL'})
66 2 373 unless (-e $filename)
73 0 375 unless ($fh)
78 0 375 if ($ENV{'UR_DBI_MONITOR_SQL'})
89 2 0 if ($self->has_default_handle)
101 1222 0 $fh ? :
109 2 0 if ($self->has_default_handle)
111 0 2 if $ENV{'UR_DBI_MONITOR_SQL'}
118 2 0 if (defined $self->{'_fh_position'})
119 0 2 if $ENV{'UR_DBI_MONITOR_SQL'}
128 26 350 unless ($self->{'_regex'})
131 0 26 if ($@ or not $r)
145 16 29 unless ($self->{'_cached_server'})
146 15 1 if ($self->__server) { }
1 0 elsif ($self->file_list) { }
170 25 1091 unless ($self->{'_offset_cache'})
185 282 90 if ($next > $MAX_CACHE_SIZE)
188 9 273 if ($last_offset_cache_slot >= $MAX_CACHE_SIZE) { }
196 0 0 if $next > $MAX_CACHE_SIZE
198 0 282 if ($next > $MAX_CACHE_SIZE or $next eq $last_offset_cache_slot)
220 0 372 unless ($cache_slot < scalar @$cache)
225 0 372 unless (defined $cache->[$cache_slot])
230 0 372 if ($$cache[$cache_slot + 1] and scalar @{$$cache[$cache_slot + 1];} == 0) { }
266 76 136 unless $propertys_column_name and exists $column_to_position_map{$propertys_column_name}
271 0 49 unless ($sql_cols)
287 12 37 if (my $constant_values = $self->constant_values)
292 36 0 if ($col >= $next_template_slot)
297 0 12 if ($next_template_slot == -1)
314 47 229 unless &Scalar::Util::looks_like_number($_)
332 44 315 if ($operator eq 'between') { }
20 295 elsif ($operator eq 'in') { }
14 281 elsif ($operator eq 'not in') { }
18 263 elsif ($operator eq 'like') { }
16 247 elsif ($operator eq 'not like') { }
185 62 elsif ($property->is_numeric and $self->_things_in_list_are_numeric([$value])) { }
333 28 16 if ($value->[0] eq '' or $value->[1] eq '')
337 16 0 if ($property->is_numeric and $self->_things_in_list_are_numeric($value)) { }
338 0 16 if ($value->[0] > $value->[1])
346 32 0 if $$next_candidate_row->[$index] eq ''
347 0 0 if ($$next_candidate_row->[$index] < $value->[0]) { }
0 0 elsif ($$next_candidate_row->[$index] > $value->[1]) { }
356 0 0 if ($value->[0] gt $value->[1])
363 0 0 if $$next_candidate_row->[$index] eq ''
364 0 0 if ($$next_candidate_row->[$index] lt $value->[0]) { }
0 0 elsif ($$next_candidate_row->[$index] gt $value->[1]) { }
375 8 12 unless (@$value)
379 8 4 if ($property->is_numeric and $self->_things_in_list_are_numeric($value)) { }
384 16 0 if $$next_candidate_row->[$index] eq ''
385 0 0 if ($$next_candidate_row->[$index] < $value->[0]) { }
0 0 elsif ($$next_candidate_row->[$index] > $value->[-1]) { }
391 0 0 if $$next_candidate_row->[$index] == $_
401 0 8 if ($$next_candidate_row->[$index] lt $value->[0]) { }
0 8 elsif ($$next_candidate_row->[$index] gt $value->[-1]) { }
407 8 0 if $$next_candidate_row->[$index] eq $_
416 4 10 unless (@$value)
420 4 6 if ($property->is_numeric and $self->_things_in_list_are_numeric($value)) { }
422 8 0 if $$next_candidate_row->[$index] eq ''
424 0 0 if $$next_candidate_row->[$index] == $_
432 12 10 if $$next_candidate_row->[$index] eq $_
442 4 14 if $value eq ''
454 24 8 if $$next_candidate_row->[$index] eq ''
455 2 6 if ($$next_candidate_row->[$index] =~ /$regex/) { }
463 4 12 if $value eq ''
468 24 0 if $$next_candidate_row->[$index] eq ''
469 0 0 if ($$next_candidate_row->[$index] =~ /$regex/) { }
480 130 55 if ($operator eq '=') { }
12 43 elsif ($operator eq '<') { }
12 31 elsif ($operator eq '<=') { }
12 19 elsif ($operator eq '>') { }
12 7 elsif ($operator eq '>=') { }
0 7 elsif ($operator eq 'true') { }
1 6 elsif ($operator eq 'false') { }
6 0 elsif ($operator eq '!=' or $operator eq 'ne') { }
482 24 1446 if $$next_candidate_row->[$index] eq ''
487 24 0 if $$next_candidate_row->[$index] eq ''
488 0 0 $$next_candidate_row->[$index] < $value ? :
492 24 0 if $$next_candidate_row->[$index] eq ''
493 0 0 $$next_candidate_row->[$index] <= $value ? :
497 24 0 if $$next_candidate_row->[$index] eq ''
498 0 0 $$next_candidate_row->[$index] > $value ? :
502 24 0 if $$next_candidate_row->[$index] eq ''
503 0 0 $$next_candidate_row->[$index] >= $value ? :
507 0 0 $$next_candidate_row->[$index] ? :
511 0 2 $$next_candidate_row->[$index] ? :
515 12 0 if $$next_candidate_row->[$index] eq ''
516 0 0 $$next_candidate_row->[$index] != $value ? :
522 25 37 if ($operator eq '=') { }
8 29 elsif ($operator eq '<') { }
8 21 elsif ($operator eq '<=') { }
8 13 elsif ($operator eq '>') { }
8 5 elsif ($operator eq '>=') { }
4 1 elsif ($operator eq 'true') { }
1 0 elsif ($operator eq 'false') { }
0 0 elsif ($operator eq '!=' or $operator eq 'ne') { }
524 0 120 if $$next_candidate_row->[$index] eq '' xor $value eq ''
529 0 16 $$next_candidate_row->[$index] lt $value ? :
533 16 0 if $$next_candidate_row->[$index] eq '' or $value eq ''
534 0 0 $$next_candidate_row->[$index] le $value ? :
538 0 16 $$next_candidate_row->[$index] gt $value ? :
542 16 0 if $$next_candidate_row->[$index] eq '' or $value eq ''
543 0 0 $$next_candidate_row->[$index] ge $value ? :
547 0 8 $$next_candidate_row->[$index] ? :
551 0 2 $$next_candidate_row->[$index] ? :
555 0 0 $$next_candidate_row->[$index] ne $value ? :
575 188 0 if (ref $_ eq 'HASH' and exists $_->{'value'})
596 0 1096 unless ($prop or $WARNED_ABOUT_COLUMN{$class_name . '::' . $column_name}++)
611 0 1096 unless ($property_meta)
615 737 359 if (not $operators_for_properties->{$property_name}) { }
129 230 elsif ($looking_for_sort_columns and $sort_column_names{$column_name}) { }
636 0 359 unless ($comparison_function)
652 129 243 if ($last_sort_column_in_rule >= 0)
657 2138 1205 unless defined $offset_cache->[$i] and defined $$offset_cache[$i + 1]
665 1190 15 if $comparison > 0
666 10 5 if ($comparison < 0)
674 10 5 if ($matched and $$offset_cache[$i + 1] > $file_pos)
681 0 372 if ($ENV{'UR_DBI_MONITOR_SQL'})
688 0 0 $i <= $last_sort_column_in_rule ? :
691 0 0 if (ref $rule_value eq 'ARRAY')
715 372 222 unless (ref $fh)
723 0 594 if ($monitor_start_time and not $monitor_printed_first_fetch)
728 374 220 if ($self->{'_last_read_serial'} ne $this_iterator_serial)
729 0 374 if $ENV{'UR_DBI_MONITOR_SQL'}
732 365 9 if ($file_pos == 0)
762 249 846 unless (defined $line)
763 0 249 if ($!)
764 0 0 if $! == 11 or $! == 4
773 0 249 if ($monitor_start_time)
791 0 846 unless ($lines_read % $cache_insert_counter)
807 121 680 if ($comparison > 0 and $i <= $last_sort_column_in_rule) { }
501 179 elsif ($comparison) { }
810 0 121 if ($monitor_start_time)
834 223 0 if ($$offset_cache[$cache_slot + 1][$column] ne $next_candidate_row->[$column])
842 0 224 if (not $printed_first_match and $monitor_start_time)
867 0 372 unless $ds
870 372 0 if (defined $cache_slot_ref and defined $$cache_slot_ref)
880 4 368 unless $ds->quick_disconnect
881 366 2 if ($count == 0 and $ds->has_default_handle)
886 0 366 if $ENV{'UR_DBI_MONITOR_SQL'}
899 1 2 unless (exists $ds_data->{'column_order'})
907 7 9 if (exists $ds_data->{$param})
908 0 7 if ($creation_param_is_list{$param} and ref $ds_data->{$param} ne 'ARRAY') { }
936 0 4 if ($join_pattern eq '\\s*,\\s*')
954 0 4 unless (ref $self)
955 0 0 if ($self->isa('UR::Singleton')) { }
964 0 4 unless ($read_fh)
971 0 4 unless (-d $original_data_dir)
974 4 0 if (-w $original_data_dir) { }
0 0 elsif (not -w $original_data_file) { }
1007 0 12 unless ($prop_meta)
1019 4 12 if ($obj->isa('UR::Object::Ghost')) { }
4 8 elsif ($obj->{'db_committed'}) { }
1040 0 4 unless (exists $column_name_to_index_map{$sort_column_name})
1052 20 0 if ($column_sorts_numerically{$column_name}) { }
1057 20 0 if $comparison != 0
1061 4 0 if ($sort_order_names and $file_is_sorted and scalar @$insert)
1069 4 0 if ($use_quick_rename) { }
1074 0 0 if $write_fh
1076 0 4 unless ($write_fh)
1081 0 4 if ($ENV{'UR_DBI_MONITOR_SQL'})
1089 0 4 unless (flock $read_fh, 1)
1090 0 0 unless ($! == 95)
1105 15 5 unless ($line)
1107 4 11 unless defined $line
1110 15 1 if ($file_is_sorted and scalar @$insert)
1116 5 10 if ($comparison > 0)
1122 0 5 if ($ENV{'UR_DBI_MONITOR_SQL'})
1132 2 9 if (my $obj = delete $delete->{$line}) { }
4 5 elsif (my $changed = delete $update->{$line}) { }
1133 0 2 if ($ENV{'UR_DBI_MONITOR_SQL'})
1140 0 4 if ($ENV{'UR_DBI_MONITOR_SQL'})
1154 0 4 if (keys %$delete)
1157 0 4 if (keys %$update)
1165 0 3 if ($ENV{'UR_DBI_MONITOR_SQL'})
1172 4 0 if ($use_quick_rename) { }
1173 0 4 if ($ENV{'UR_DBI_MONITOR_SQL'})
1177 0 4 unless (rename $temp_file_name, $original_data_file)
1184 0 0 if ($ENV{'UR_DBI_MONITOR_SQL'})
1188 0 0 unless ($new_write_fh)
1194 0 0 unless ($temp_file_fh)
1211 0 4 if ($ENV{'UR_DBI_MONITOR_SQL'})
1223 0 4 unless ($self->_set_specified_objects_saved_uncommitted($changed_objects))