Branch Coverage

blib/lib/Web/MREST/Resource.pm
Criterion Covered Total %
branch 104 156 66.6


line true false branch
123 445 1517 if @_
124 69 1893 unless ($self->{'context'})
200 0 29 if (exists $self->context->{'declared_status'})
210 2 27 if (@ARGS and ref $ARGS[0] eq 'App::CELL::Status') { }
218 2 0 unless ($declared_status->payload)
223 1 1 if (my $hc = delete $declared_status->{'http_code'})
229 0 2 if (my $pt = delete $declared_status->{'permanent'}) { }
230 0 0 $pt ? :
247 27 0 unless $ARGS{'args'}
254 26 1 $ARGS{'permanent'} ? :
288 0 4 unless ref $self->context->{'declared_status'} eq 'App::CELL::Status'
292 1 3 if ($arg)
316 0 2 unless ref $self->context->{'declared_status'} eq 'App::CELL::Status'
331 34 107 if (my $declared_status_object = $self->context->{'declared_status'})
333 0 34 if (ref $declared_status_object ne 'App::CELL::Status')
383 69 0 unless $muffle{'1'}
385 20 49 unless ref $Web::MREST::Resource::router and $Web::MREST::Resource::router->can('match')
389 6 63 $path eq '' ? :
413 68 0 unless $muffle{'1'}
426 68 0 unless $muffle{'1'}
430 68 0 unless $muffle{'1'}
432 1 67 unless (grep {$method eq $_;} @$known_methods)
433 1 0 unless $muffle{'1'}
448 67 0 unless $muffle{'1'}
452 1 66 if (length $uri > $max_len)
479 66 0 unless $muffle{'1'}
486 66 0 unless $muffle{'1'}
487 66 0 if (my $match = $Web::MREST::Resource::router->match($path))
492 66 0 defined $resource_name ? :
502 54 12 if ($def) { }
512 0 54 if ($self->status_declared)
529 66 0 unless $muffle{'1'}
552 284 181 unless $method =~ /(resource_name)|(parent)|(children)|(documentation)/
554 66 0 unless $muffle{'1'}
562 54 0 unless $muffle{'1'}
565 0 54 $Web::MREST::Resource::site->MREST_URI ? :
581 54 0 unless $muffle{'1'}
584 0 54 if (my $handler_from_context = $self->context->{'handler'})
590 54 0 if ($handler_name = $def->{'handler'}) { }
599 0 54 if ($status) { }
617 54 0 unless $muffle{'1'}
621 31 23 unless $method =~ /^(PUT)|(POST)$/
626 3 20 unless defined $content_type
628 0 23 unless defined $content_length
633 13 10 if ($self->request->content)
634 2 11 if ($content_type eq '<NONE>' or $content_length eq '<NONE>')
661 21 0 unless $muffle{'1'}
675 48 0 unless $muffle{'1'}
688 44 0 unless $muffle{'1'}
703 44 0 unless $muffle{'1'}
704 44 0 unless $muffle{'1'}
708 0 44 unless ref $valid_content_headers eq 'ARRAY'
714 2 86 unless (exists $valids->{$content_header})
728 105 203 unless $chn =~ /^Content-/
751 42 0 unless $muffle{'1'}
753 0 42 unless $content_type
757 42 0 if ($ct_isa)
758 42 0 unless $muffle{'1'}
759 0 42 if ($ct_isa ne 'HTTP::Headers::ActionPack::MediaType')
767 42 0 unless $muffle{'1'}
774 41 1 if (exists $types{$content_type})
793 41 0 unless $muffle{'1'}
797 1 40 if ($body_len > $max_len)
861 0 39 unless (exists $self->context->{'handler'})
880 34 5 if $bool
888 5 0 unless ($self->status_declared)
891 2 3 if ($method eq 'GET') { }
1 2 elsif ($method eq 'DELETE') { }
916 1 0 unless $self->status_declared
947 9 1 unless (defined $pic)
951 1 0 if ($pic)
969 0 1 if $self->status_declared
986 0 1 unless (defined $create_path)
1055 0 1 if ref $status eq 'SCALAR' or $self->context->{'handler_status'}->not_ok
1075 69 0 unless ($Web::MREST::Resource::site->MREST_CACHE_ENABLED)
1088 0 69 if ($metadata->{'exception'})
1098 26 43 if ($self->status_declared)
1101 23 3 if (not $declared_status->payload->{'http_code'}) { }