Branch Coverage

lib/Geo/ShapeFile.pm
Criterion Covered Total %
branch 80 128 62.5


line true false branch
47 14 28 if ($$args{'no_cache'})
66 39 3 if ($self->file_exists($$self{'filebase'} . '.shx'))
71 39 3 if ($self->file_exists($$self{'filebase'} . '.shp'))
76 40 2 if ($self->file_exists($$self{'filebase'} . '.dbf'))
81 2 40 unless ($$self{'has_dbf'})
83 2 0 unless $$self{'has_shp'} and $$self{'has_shx'}
96 40 0 if (-e $file_name) { }
114 118 8 if -e $file_name
140 0 27430 if (defined $flag)
149 37008 27430 if $$self{'_no_cache'}
152 0 27430 if $$self{'_change_cache'}{$type} and $$self{'_change_cache'}{$type}{$obj}
154 0 27430 unless $self->caching($type)
156 8371 19059 if ($cache)
175 6 2 wantarray ? :
183 2 0 unless (defined $sub)
190 1 1 unless (defined $shapes)
196 2 0 wantarray ? :
204 0 0 unless (defined $sub)
265 78 0 $little_endian_sys ? :
286 0 28 unless defined $$self{'dbf_field_names'}
291 28 0 wantarray ? :
319 40 0 if ord $last_byte == 26
321 0 40 if $ls != $li
332 36 352 if ord $chr == 13
333 4 348 if length $tmp < 32
349 0 40 if $count < 1
355 0 348 if $$_{'size'} < 1
358 0 348 if $$_{'size'} > 4000
407 0 0 unless $header
417 0 0 wantarray ? :
426 6939 2313 unless ($dbf)
445 4626 4626 wantarray ? :
461 0 0 unless (defined $$self{'shx_' . $val} or defined $$self{'shp_' . $val})
467 146 0 defined $$self{'shx_' . $val} ? :
507 2 26 unless $self->records
515 2 26 unless $self->records
568 0 28 if defined $$self{'_change_cache'}{'shape_type'}
577 0 214 if defined $$self{'_change_cache'}{'records'}
579 0 214 unless ($$self{'shx_file_length'})
593 0 197 if defined $$self{'_change_cache'}{'records'}
595 196 1 if ($$self{'shx_file_length'}) { }
0 1 elsif ($$self{'dbf_num_records'}) { }
622 0 17630 unless $entry
627 12520 5110 unless ($shx)
654 2 10 if (my $sp_index = $self->get_spatial_index)
661 0 2 wantarray ? :
670 0 962 if $self->type($type) eq 'Null'
672 0 962 if ($self->type($type) =~ /^Point/) { }
962 0 elsif ($self->type($type) =~ /^(PolyLine|Polygon|MultiPoint|MultiPatch)/) { }
674 0 0 $little_endian_sys ? :
680 0 0 if ($self->area_contains_point($pt, @area))
686 962 0 $little_endian_sys ? :
691 615 347 if ($self->check_in_area(@p, @area))
700 8 2 wantarray ? :
726 0 0 if ($_[0] > $_[1])
748 0 0 $end =~ /^l/i ? :
761 7416 3265 unless ($shape)
792 118 33505 unless ($$self{$han})
794 118 0 if (-e $file) { }
797 0 118 unless $$self{$han}->open($file, 0)
820 0 33623 unless $h->seek($offset, 0)
826 0 33623 unless defined $res
829 0 33623 if $res == 0
865 2 26 unless scalar @objects