Branch Coverage

blib/lib/Yancy/Controller/Yancy.pm
Criterion Covered Total %
branch 85 94 90.4


line true false branch
223 0 544 if ($self->stash("collection"))
241 7 149 if (ref $id_field eq "ARRAY")
243 5 2 keys %$id == @$id_field ? :
257 1217 3 unless not $props->{$_}
434 4 14 unless ($c->stash("template"))
513 1 26 unless ($id)
515 0 1 $id_field eq 'ARRAY' ? :
519 1 25 if (my $join = $c->stash("join"))
523 2 24 unless ($item)
709 13 42 if ($c->req->method eq "GET")
710 9 4 if (defined $id) { }
725 5 72 if $props->{$key}{'format'} and $props->{$key}{'format'} eq "password"
750 4 38 if ($c->accepts("html") and $c->validation->csrf_protect->has_error("csrf_token"))
778 1 17 if ($allowed_props and $data->{$key} and not grep({$_ eq $key;} @$allowed_props))
783 16 289 if ($format eq 'password') { }
1 561 elsif ($format eq 'filepath' and my $upload = $c->param($key)) { }
784 1 13 if (exists $data->{$key} and !defined($data->{$key}) || $data->{$key} eq '')
796 1 37 if (@errors)
824 23 14 if ($has_id) { }
827 1 22 if (ref $id_field eq 'ARRAY') { }
841 3 34 if (my $errors = $@)
842 1 2 if (ref $errors eq 'ARRAY') { }
872 14 10 $has_id ? :
878 6 4 if (my $route = $c->stash("forward_to"))
967 1 21 unless ($id)
969 0 1 $id_field eq 'ARRAY' ? :
975 4 17 if ($c->req->method eq "GET")
993 2 15 if ($c->accepts("html") and $c->validation->csrf_protect->has_error("csrf_token"))
1021 4 2 if (my $route = $c->stash("forward_to"))
1168 0 1 ref $x_id_field eq 'ARRAY' ? :
1186 16 40 if (@id_fields == grep({$new_item->{$_} eq $old_item->{$_};} @id_fields))
1194 1 15 if (keys %diff)
1247 3 52 $c->param('$offset') ? :
0 55 $c->param('$page') ? :
1254 7 48 if (my $order_by = $c->param('$order_by')) { }
8 40 elsif ($order_by = $c->stash('order_by')) { }
1256 6 1 $_->[1] ? :
1265 1 54 if (my $join = $c->stash("join"))
1273 15 23 unless exists $props->{$key}
1276 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')) { }
1277 11 6 if ($value =~ tr/*/%/ <= 0)
1286 0 3 $value && $value ne 'false' ? :
1302 1 52 if ($c->param("\$match") and $c->param("\$match") eq "any")
1318 2 54 if (ref $filter eq "CODE")