Branch Coverage

blib/lib/Yancy/Controller/Yancy.pm
Criterion Covered Total %
branch 79 88 89.7


line true false branch
223 0 538 if ($self->stash("collection"))
241 7 148 if (ref $id_field eq "ARRAY")
243 5 2 keys %$id == @$id_field ? :
430 4 14 unless ($c->stash("template"))
505 1 25 unless ($id)
507 0 1 $id_field eq 'ARRAY' ? :
511 2 23 unless ($item)
697 13 42 if ($c->req->method eq "GET")
698 9 4 if (defined $id) { }
713 5 72 if $props->{$key}{'format'} and $props->{$key}{'format'} eq "password"
738 4 38 if ($c->accepts("html") and $c->validation->csrf_protect->has_error("csrf_token"))
766 1 17 if ($allowed_props and $data->{$key} and not grep({$_ eq $key;} @$allowed_props))
771 16 289 if ($format eq 'password') { }
1 561 elsif ($format eq 'filepath' and my $upload = $c->param($key)) { }
772 1 13 if (exists $data->{$key} and !defined($data->{$key}) || $data->{$key} eq '')
784 1 37 if (@errors)
812 23 14 if ($has_id) { }
815 1 22 if (ref $id_field eq 'ARRAY') { }
829 3 34 if (my $errors = $@)
830 1 2 if (ref $errors eq 'ARRAY') { }
860 14 10 $has_id ? :
866 6 4 if (my $route = $c->stash("forward_to"))
955 1 21 unless ($id)
957 0 1 $id_field eq 'ARRAY' ? :
963 4 17 if ($c->req->method eq "GET")
981 2 15 if ($c->accepts("html") and $c->validation->csrf_protect->has_error("csrf_token"))
1009 4 2 if (my $route = $c->stash("forward_to"))
1156 0 1 ref $x_id_field eq 'ARRAY' ? :
1174 16 40 if (@id_fields == grep({$new_item->{$_} eq $old_item->{$_};} @id_fields))
1182 1 15 if (keys %diff)
1235 3 51 $c->param('$offset') ? :
0 54 $c->param('$page') ? :
1242 7 47 if (my $order_by = $c->param('$order_by')) { }
8 39 elsif ($order_by = $c->stash('order_by')) { }
1244 6 1 $_->[1] ? :
1257 15 23 unless exists $props->{$key}
1260 17 6 if (is_type($type, 'string')) { }
3 3 elsif (grep is_type($type, $_), ('number', 'integer')) { }
3 0 elsif (is_type($type, 'boolean')) { }
0 0 elsif (is_type($type, 'array')) { }
1261 11 6 if ($value =~ tr/*/%/ <= 0)
1270 0 3 $value && $value ne 'false' ? :
1286 1 51 if ($c->param("\$match") and $c->param("\$match") eq "any")
1302 2 53 if (ref $filter eq "CODE")