Branch Coverage

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


line true false branch
95 0 119 unless (eval { do { $self->util->dbh->rollback; 1 } })
111 0 254 if (defined $util)
120 0 149 if ($type ne 'view' and $type ne 'model')
128 149 0 if ($util->config->SectionExists('packagemap'))
133 3 146 if ($map)
155 0 1785 unless $1
159 6 113 if ($xhr and not $pi =~ m[(?:$accept_extensions)(?:/[^/]*?)?$]msx)
160 1 5 if ($pi =~ /[;]/msx) { }
173 12 48 if ($action eq 'read' and not $id and not $aspect)
177 28 91 if ($action eq 'create' and $id)
178 25 3 if (not $aspect or $aspect =~ /^update/msx) { }
1 2 elsif ($aspect =~ /^delete/msx) { }
193 53 66 if ($uriaspect ne $aspect)
210 2 117 unless ($entity)
218 1 118 unless ($entity)
224 39 79 if ($aspect_extra)
228 34 84 if ($id eq '0') { }
35 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 24 11 if ($tmp =~ /_/msx) { }
266 18 17 if ($aspect_extra)
270 15 20 if ($viewclass->can($tmp)) { }
277 5 10 if ($aspect =~ /^create/msx)
282 16 4 if ($aspect_extra)
283 11 5 if ($aspect =~ /_/msx) { }
295 11 10 if ($aspect =~ /_/msx) { }
306 57 61 if ($firstpart)
308 8 49 if ($restpart)
310 8 0 if ($restpart)
312 8 0 if ($crudpart)
319 23 95 unless ($aspect =~ /^(?:create|read|update|delete|add|list|edit|options)/msx)
321 8 15 unless ($id)
327 6 17 $aspect ? :
339 3 115 unless ($method =~ /^$ClearPress::controller::REST->{$type}$/msx)
344 4 111 if (not $id and $aspect =~ /^(?:delete|update|edit|read)/msx)
350 3 108 if ($id and $aspect =~ /^(?:create|add|list)/msx)
369 53 1732 if ($extensions =~ s/$ext$//msx)
385 1 237 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 118 62 if (ref $self and not $self->{'namespace'} or not ref $self) { }
679 118 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)