Branch Coverage

blib/lib/MyLibrary/Resource.pm
Criterion Covered Total %
branch 57 306 18.6


line true false branch
683 0 1 if ($opts{'id'}) { }
0 1 elsif ($opts{'name'}) { }
0 1 elsif ($opts{'fkey'}) { }
692 0 0 if (ref $rv eq 'HASH') { }
708 0 0 if (ref $rv eq 'HASH') { }
710 0 0 if (wantarray) { }
735 0 0 if (ref $rv eq 'HASH') { }
744 1 0 unless ($$self{'resource_lcd'})
747 1 0 unless ($$self{'resource_proxied'})
750 1 0 unless ($$self{'resource_full_text'})
753 1 0 unless ($$self{'resource_reference_linking'})
765 0 0 if our $AUTOLOAD =~ /::DESTROY$/
769 0 0 unless $AUTOLOAD =~ /.*::delete_(\w+)/
771 0 0 unless exists $$self{"resource_$1"}
773 0 0 if (not $1 eq 'name' || $1 eq 'lcd' || $1 eq 'proxied' || $1 eq 'full_text' || $1 eq 'reference_linking') { }
785 1 1 if ($name) { }
795 1 1 if ($note) { }
804 1 1 if ($creator) { }
813 1 1 if ($publisher) { }
823 1 1 if ($contributor) { }
832 1 1 if ($coverage) { }
841 1 1 if ($language) { }
851 1 1 if ($rights) { }
860 1 1 if ($source) { }
870 1 1 if ($relation) { }
879 1 1 if ($format) { }
888 1 1 if ($type) { }
897 1 1 if ($subject) { }
906 1 1 if ($create_date) { }
916 1 1 if (not $lcd) { }
1 0 elsif ($lcd eq '1' or $lcd eq '0') { }
931 1 1 if (not $access_note) { }
1 0 elsif ($access_note) { }
943 1 1 if (not $coverage_info) { }
1 0 elsif ($coverage_info) { }
955 1 1 if (not $full_text) { }
1 0 elsif ($full_text eq '1' or $full_text eq '0') { }
969 2 0 if (not $reference_linking) { }
0 0 elsif ($reference_linking eq '1' or $reference_linking eq '0') { }
983 2 0 if (not $proxied) { }
0 0 elsif ($proxied eq '1' or $proxied eq '0') { }
996 1 1 if ($fkey) { }
1006 1 1 if ($qsearch_prefix) { }
1016 1 1 if ($qsearch_suffix) { }
1026 1 1 if ($date) { }
1050 0 0 if ($self->id and scalar $dbh->selectrow_array('SELECT resource_id FROM resources WHERE resource_id = ?', undef, $self->id) >= 1) { }
1054 0 0 if ($return > 1 or not $return)
1057 0 0 if (scalar @related_terms > 0 and @related_terms)
1060 0 0 if (scalar @{$arr_ref;} > 0)
1064 0 0 if ($$arr_val[0] == $related_terms[$i])
1074 0 0 if ($return > 1 or not $return)
1079 0 0 if (scalar @{$arr_ref;} > 0)
1083 0 0 if ($$arr_val[0] == $related_terms[$i]) { }
1090 0 0 unless ($found)
1098 0 0 if ($return > 1 or not $return)
1107 0 0 if (not $self->id) { }
1115 0 0 if ($return > 1 or not $return)
1119 0 0 if (scalar @related_terms > 0 and @related_terms)
1122 0 0 if ($return > 1 or not $return)
1136 0 0 if ($$self{'resource_id'})
1144 0 0 if ($rv != 1)
1146 0 0 if ($rv > 0)
1148 0 0 if ($rv < 1 or not $rv)
1151 0 0 if ($rv > 0)
1153 0 0 if ($rv < 1 or not $rv)
1174 0 0 if (%opts)
1175 0 0 if ($opts{'sort'})
1178 0 0 if ($opts{'list'} and not $opts{'field'})
1181 0 0 if ($opts{'field'} and $opts{'value'} and not $opts{'list'})
1184 0 0 if ($field eq 'name') { }
0 0 elsif ($field eq 'description') { }
0 0 elsif ($field eq 'fkey') { }
0 0 elsif ($field eq 'access_note') { }
0 0 elsif ($field eq 'date_range') { }
0 0 elsif ($field eq 'creator') { }
1198 0 0 if ($opts{'output'})
1202 0 0 unless ($output)
1206 0 0 if (@list_ids and scalar @list_ids >= 1)
1217 0 0 if (not $sort and $list_of_ids) { }
0 0 elsif (not $sort) { }
0 0 elsif ($sort and $sort eq 'name' and not $list_of_ids and not $field and not $value) { }
0 0 elsif ($sort and $sort eq 'name' and not $list_of_ids and $field and $value) { }
0 0 elsif (not $sort and $sort eq 'name' and not $list_of_ids and $field and $value) { }
0 0 elsif ($sort and $sort eq 'name' and $list_of_ids) { }
0 0 elsif ($sort and $sort eq 'creator' and $list_of_ids) { }
1222 0 0 if ($field ne 'date_range') { }
0 0 elsif ($field eq 'date_range') { }
1236 0 0 if ($field ne 'date_range') { }
0 0 elsif ($field eq 'date_range') { }
1252 0 0 if ($output eq 'object') { }
0 0 elsif ($output eq 'id') { }
1284 0 0 if ($first_parameter)
1285 0 0 if ($first_parameter ne 'new' and $first_parameter ne 'del')
1288 0 0 if (@lcd_resources and scalar @lcd_resources > 0)
1292 0 0 unless ($lcd_resource_id =~ /^\d+$/)
1296 0 0 if ($lcd_resource_id == $resource_id) { }
1303 0 0 unless ($found)
1308 0 0 if ($first_parameter eq 'new' and @lcd_resources) { }
0 0 elsif ($first_parameter eq 'del' and @lcd_resources) { }
1311 0 0 if ($rv > 1 or not $rv)
1318 0 0 if ($rv > 1 or not $rv)
1341 0 0 unless ($args{'resource_id'})
1349 0 0 unless ($q_prefix)
1353 0 0 unless ($args{'qsearch_arg'})
1389 0 0 if ($opts{'term_name'}) { }
0 0 elsif ($opts{'term_id'}) { }
0 0 elsif ($opts{'facet_name'}) { }
0 0 elsif ($opts{'facet_id'}) { }
1393 0 0 if ($term->term_name eq $opts{'term_name'})
1401 0 0 if ($term_id == $opts{'term_id'})
1410 0 0 unless ($facet)
1415 0 0 if ($term_id == $facet_term_id)
1420 0 0 if ($rv)
1428 0 0 unless ($facet)
1433 0 0 if ($term_id == $facet_term_id)
1438 0 0 if ($rv)
1451 0 0 if ($opts{'new'})
1455 0 0 if ($opts{'del'})
1460 0 0 if ($opts{'strict'}) { }
1461 0 0 if ($opts{'strict'} == 1) { }
0 0 elsif ($opts{'strict'} == 0) { }
0 0 elsif (not $opts{'strict'} =~ /^\d$/ and $opts{'strict'} == 1 || $opts{'strict'} == 0 or $opts{'strict'} ne 'off' or $opts{'strict'} ne 'on') { }
1473 0 0 if (@new_related_terms)
1475 0 0 unless ($new_related_term =~ /^\d+$/)
1478 0 0 if ($strict_relations eq 'on')
1483 0 0 if ($term_list_val == $new_related_term) { }
1490 0 0 if ($found_term == 0)
1495 0 0 if ($$self{'related_terms'}) { }
1497 0 0 if ($new_related_term == @$related_term[0])
1504 0 0 if ($found) { }
1514 0 0 if (@del_related_terms)
1518 0 0 if ($$self{'related_terms'}[$i][0] == $del_related_term)
1537 0 0 unless ($self->id)
1540 0 0 unless ($opts{'location'})
1543 0 0 unless ($opts{'location_type'})
1549 0 0 if (scalar @resource_locations >= 1)
1552 0 0 if ($location->resource_id == $self->id)
1558 0 0 if ($found)
1561 0 0 unless ($found)
1566 0 0 if ($opts{'location_note'})
1580 0 0 if (ref $location_object ne 'MyLibrary::Resource::Location')
1593 0 0 if (ref $location_object ne 'MyLibrary::Resource::Location')
1596 0 0 unless ($opts{'resource_location'} or $opts{'location_note'})
1599 0 0 if ($opts{'resource_location'})
1602 0 0 if ($opts{'location_note'}) { }
0 0 elsif (not $opts{'location_note'} or $opts{'location_note'} =~ /^\s+$/) { }
1615 0 0 if (not $opts{'resource_location'} || $opts{'id'}) { }
0 0 elsif ($opts{'resource_location'} and $opts{'id'}) { }
1620 0 0 if ($opts{'id'}) { }
0 0 elsif ($opts{'resource_location'}) { }
1625 0 0 if (scalar @locations >= 1) { }
1627 0 0 if ($location->resource_id == $self->id)
1645 0 0 unless ($self->id =~ /\d+/)