Branch Coverage

blib/lib/ClearPress/controller.pm
Criterion Covered Total %
branch 105 136 77.2


line true false branch
95 0 107 unless (eval { do { $self->util->dbh->rollback; 1 } })
111 0 230 if (defined $util)
120 0 137 if ($type ne 'view' and $type ne 'model')
128 137 0 if ($util->config->SectionExists('packagemap'))
133 3 134 if ($map)
155 0 1605 unless $1
159 6 101 if ($xhr and not $pi =~ m[(?:$accept_extensions)(?:/[^/]*?)?$]msx)
160 1 5 if ($pi =~ /[;]/msx) { }
173 12 42 if ($action eq 'read' and not $id and not $aspect)
177 22 85 if ($action eq 'create' and $id)
178 19 3 if (not $aspect or $aspect =~ /^update/msx) { }
1 2 elsif ($aspect =~ /^delete/msx) { }
193 45 62 if ($uriaspect ne $aspect)
210 2 105 unless ($entity)
218 1 106 unless ($entity)
224 27 79 if ($aspect_extra)
228 34 72 if ($id eq '0') { }
23 49 elsif (not $id =~ /^\d+$/msx) { }
21 28 elsif ($aspect_extra) { }
236 0 34 if ($aspect_extra)
239 0 0 if ($viewclass->can($tmp))
255 16 7 if ($tmp =~ /_/msx) { }
266 6 17 if ($aspect_extra)
270 15 8 if ($viewclass->can($tmp)) { }
277 5 10 if ($aspect =~ /^create/msx)
282 4 4 if ($aspect_extra)
283 3 1 if ($aspect =~ /_/msx) { }
295 11 10 if ($aspect =~ /_/msx) { }
306 49 57 if ($firstpart)
308 8 41 if ($restpart)
310 8 0 if ($restpart)
312 8 0 if ($crudpart)
319 19 87 unless ($aspect =~ /^(?:create|read|update|delete|add|list|edit|options)/msx)
321 8 11 unless ($id)
327 2 17 $aspect ? :
339 3 103 unless ($method =~ /^$ClearPress::controller::REST->{$type}$/msx)
344 4 99 if (not $id and $aspect =~ /^(?:delete|update|edit|read)/msx)
350 3 96 if ($id and $aspect =~ /^(?:create|add|list)/msx)
369 45 1560 if ($extensions =~ s/$ext$//msx)
385 1 213 if (${$accept;} =~ /$header$/msx)
399 15 31 unless ($self->{'decorator'})
412 15 0 unless (eval { do { $decor = $decorpkg->new($ref); 1 } })
420 15 0 unless ($decor->title)
427 15 0 if ($headers)
442 13 2 unless (ref $self)
458 15 0 if ($lang and scalar @{$lang;})
466 0 15 unless (eval { do { ($action, $entity, $aspect, $id) = $self->process_request($headers); 1 } })
488 0 15 if ($process_request_error)
502 0 15 unless (eval { do { $viewobject = $self->dispatch($params); 1 } })
514 15 0 $charset && !exists $ENV{'REDIRECT_STATUS'} ? :
522 6 9 if ($decor)
538 1 14 if ($viewobject->streamed) { }
552 1 14 unless (eval { do { if ($viewobject->streamed) { $viewobject->render; } else { $viewobject->output_buffer($viewobject->render); } ; 1 } })
565 1 0 if (not $code or $code == 200)
584 5 9 if ($viewobject->decor)
642 1 0 unless (eval { do { $viewobject = $error_ns->new($params); 1 } })
654 1 0 if ($viewobject->decor)
674 106 62 if (ref $self and not $self->{'namespace'} or not ref $self) { }
679 106 0 if (ref $self)
695 15 42 if ($ent eq $viewname)
706 0 2 if ($str)
724 0 15 unless ($state)
733 15 0 if ($entity ne 'error')
737 13 2 $modelpk ? :
742 0 15 unless (eval { do { my $modelpk = $modelclass->primary_key; $modelobject = $modelclass->new({'util', $util, $modelpk ? ($modelpk, $id) : ()}); 1 } })
747 0 0 if (not $code or $code == 200)
767 0 15 unless (eval { do { $viewobject = $viewclass->new({'util', $util, 'model', $modelobject, 'action', $action, 'aspect', $aspect, 'entity_name', $entity_name, 'decorator', $self->decorator, 'headers', $headers}); 1 } })
770 0 0 if (not $code or $code == 200)