Branch Coverage

blib/lib/ClearPress/controller.pm
Criterion Covered Total %
branch 107 140 76.4


line true false branch
94 0 91 unless (eval { do { $self->util->dbh->rollback; 1 } })
110 0 198 if (defined $util)
119 0 121 if ($type ne 'view' and $type ne 'model')
127 121 0 if ($util->config->SectionExists('packagemap'))
132 2 119 if ($map)
154 0 1365 unless $1
158 5 86 if ($xhr and not $pi =~ m[(?:$accept_extensions)(?:/[^/]*?)?$]msx)
159 1 4 if ($pi =~ /[;]/msx) { }
172 12 42 if ($action eq 'read' and not $id and not $aspect)
176 22 69 if ($action eq 'create' and $id)
177 19 3 if (not $aspect or $aspect =~ /^update/msx) { }
1 2 elsif ($aspect =~ /^delete/msx) { }
192 35 56 if ($uriaspect ne $aspect)
209 2 89 unless ($entity)
217 1 90 unless ($entity)
223 20 70 if ($aspect_extra)
227 32 58 if ($id eq '0') { }
18 40 elsif (not $id =~ /^\d+$/msx) { }
16 24 elsif ($aspect_extra) { }
235 0 32 if ($aspect_extra)
238 0 0 if ($viewclass->can($tmp))
254 13 5 if ($tmp =~ /_/msx) { }
265 4 14 if ($aspect_extra)
269 13 5 if ($viewclass->can($tmp)) { }
276 5 8 if ($aspect =~ /^create/msx)
281 2 3 if ($aspect_extra)
282 2 0 if ($aspect =~ /_/msx) { }
294 8 8 if ($aspect =~ /_/msx) { }
305 37 53 if ($firstpart)
307 8 29 if ($restpart)
309 8 0 if ($restpart)
311 8 0 if ($crudpart)
318 15 75 unless ($aspect =~ /^(?:create|read|update|delete|add|list|edit)/msx)
320 7 8 unless ($id)
326 1 14 $aspect ? :
329 1 89 if ($method eq 'OPTIONS')
338 3 87 unless ($method =~ /^$ClearPress::controller::REST->{$type}$/msx)
343 4 83 if (not $id and $aspect =~ /^(?:delete|update|edit|read)/msx)
349 3 80 if ($id and $aspect =~ /^(?:create|add|list)/msx)
368 35 1330 if ($extensions =~ s/$ext$//msx)
384 1 181 if (${$accept;} =~ /$header$/msx)
398 15 31 unless ($self->{'decorator'})
411 15 0 unless (eval { do { $decor = $decorpkg->new($ref); 1 } })
419 15 0 unless ($decor->title)
426 15 0 if ($headers)
441 13 2 unless (ref $self)
457 15 0 if ($lang and scalar @{$lang;})
465 0 15 unless (eval { do { ($action, $entity, $aspect, $id) = $self->process_request($headers); 1 } })
487 0 15 if ($process_request_error)
501 0 15 unless (eval { do { $viewobject = $self->dispatch($params); 1 } })
513 15 0 $charset && !exists $ENV{'REDIRECT_STATUS'} ? :
521 6 9 if ($decor)
522 6 0 if ($content_type =~ /text/msx and $charset =~ /utf-?8/imsx)
537 1 14 if ($viewobject->streamed) { }
551 1 14 unless (eval { do { if ($viewobject->streamed) { $viewobject->render; } else { $viewobject->output_buffer($viewobject->render); } ; 1 } })
564 1 0 if (not $code or $code == 200)
583 5 9 if ($viewobject->decor)
641 1 0 unless (eval { do { $viewobject = $error_ns->new($params); 1 } })
653 1 0 if ($viewobject->decor)
673 90 62 if (ref $self and not $self->{'namespace'} or not ref $self) { }
678 90 0 if (ref $self)
694 15 42 if ($ent eq $viewname)
705 0 2 if ($str)
723 0 15 unless ($state)
732 15 0 if ($entity ne 'error')
736 13 2 $modelpk ? :
741 0 15 unless (eval { do { my $modelpk = $modelclass->primary_key; $modelobject = $modelclass->new({'util', $util, $modelpk ? ($modelpk, $id) : ()}); 1 } })
746 0 0 if (not $code or $code == 200)
766 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 } })
769 0 0 if (not $code or $code == 200)