Branch Coverage

blib/lib/ClearPress/view.pm
Criterion Covered Total %
branch 114 172 66.2


line true false branch
43 76 4 $util ? :
45 1 79 $username ? :
53 18 62 $aspect =~ /(?:rss|atom|ajax|xml)$/msx ? :
54 6 56 $aspect =~ /(?:js|json)$/msx ? :
55 0 56 $aspect =~ /_svg$/msx ? :
56 0 56 $aspect =~ /_svgz$/msx ? :
57 2 54 $aspect =~ /_png$/msx ? :
58 2 52 $aspect =~ /_jpg$/msx ? :
59 0 52 $aspect =~ /_txt$/msx ? :
60 0 52 $aspect =~ /_csv$/msx ? :
61 0 52 $aspect =~ /_xls$/msx ? :
81 0 0 unless (defined $string)
93 1 3 unless (defined $string)
101 0 0 unless (defined $string)
120 0 0 if ($lang and not $ClearPress::view::LEXICON_CACHE->{$lang})
128 0 0 unless (eval { do { $loc = $util->{'localizers'}{$lang}->maketext($string); 1 } })
129 0 0 if $DEBUG_L10N
148 76 4 $util ? :
167 1 1 if (defined $val)
180 16 9 unless ($requestor)
187 2 7 if ($action =~ /^list/msx or $action eq 'read' and not $aspect =~ /^(?:add|edit|delete|update|create)/msx) { }
199 3 4 if ($requestor->can('is_member_of') and $requestor->is_member_of('admin'))
211 1 21 if (scalar @args)
215 2 20 if (exists $self->{'template_override'})
220 6 14 unless ($name)
227 1 19 unless ($method)
238 1 18 if (-e "$path/$tmp.tt2")
253 1 36 unless ($method)
257 1 32 if ($pk and $method eq 'read' and not $model->$pk)
277 2 30 if ($aspect eq $str_aspect)
290 0 17 unless ($util)
296 0 17 unless ($self->authorised)
302 0 0 unless ($requestor)
307 0 0 unless ($username)
317 0 17 unless ($method =~ /^(?:add|edit|create|read|update|delete|list|options)/msx)
321 17 0 if ($self->can($method)) { }
322 0 17 if ($aspect eq 'options' or $aspect =~ /_(?:jpg|png|gif|svg|svgz)/msx)
332 1 16 if ($streamed)
338 1 16 if ($streamed)
350 8 8 if ($self->decor)
357 0 8 unless (eval { do { $self->process_template('warnings.tt2', {'warnings', $self->warnings}, \$warnings) } })
387 0 35 $ENV{'HTTP_X_FORWARDED_PROTO'} || $ENV{'HTTPS'} ? :
388 0 35 $http_port ? :
0 35 $script_name eq '/' ? :
414 0 35 unless $extra_params
425 22 13 unless ($template_cache->{$template})
427 1 21 unless open my $fh, '<', "$path/$template"
430 0 21 unless close $fh
435 34 0 if ($where_to_ref) { }
436 0 34 unless $self->tt->process($template, $params, $where_to_ref)
439 0 0 unless $self->tt->process($template, $params, $where_to_ref)
460 14 0 if ($pk)
480 6 8 if ($postdata)
488 1 5 unless (eval { do { $params = $json->decode($postdata); 1 } })
493 0 0 if (ref $params->{$k} and ref $params->{$k} eq 'HASH' and not scalar keys %{$$params{$k};})
501 0 6 unless (eval { do { my $json = 'JSON'->new->utf8; unless (eval { do { $params = $json->decode($postdata); 1 } }) { $params = XMLin($postdata); } ; foreach my $k (%{$params;}) { if (ref $params->{$k} and ref $params->{$k} eq 'HASH' and not scalar keys %{$$params{$k};}) { delete $params->{$k}; } ; } ; 1 } })
513 1 13 if ($xml)
517 0 0 if (ref $params->{$k} and ref $params->{$k} eq 'HASH' and not scalar keys %{$$params{$k};})
526 28 13 unless (exists $params->{$field})
535 13 0 if ($self->autoescape)
571 0 2 unless $model->delete
586 0 7 unless $model->update
600 0 6 unless $model->create
608 0 320 unless ($name and $code)
620 80 251 unless ($self->{'tt_filters'})
635 0 36 if ($tt)
639 9 27 unless ($util->{'tt'})
646 9 0 $ns ? :
657 54 0 unless (exists $opts->{$k})
662 0 9 unless $util->{'tt'} = 'Template'->new($opts)
674 26 375 if (substr($aspect, -length($ending), length $ending) eq $ending)
683 1 18 if $DEBUG_OUTPUT
686 0 19 unless print grep({$_;} @{$$self{'output_buffer'};})
689 0 19 unless (eval { do { croak($ClearPress::view::ERRNO) unless print grep({$_;} @{$$self{'output_buffer'};}); 1 } })
702 14 1 unless ($self->output_finished)
703 0 14 if (scalar @args == 2 and $args[1] eq "\n" and not $args[0])
707 0 14 if $DEBUG_OUTPUT
714 31 2 unless ($self->output_finished)
715 0 1 if (scalar @args == 2 and $args[1] eq "\n" and not $args[0])
720 2 29 if $DEBUG_OUTPUT
727 18 48 if (defined $val)
729 1 17 if $DEBUG_OUTPUT
736 1 17 if $DEBUG_OUTPUT
744 2 21 if $DEBUG_OUTPUT
769 0 0 if ($TRAP_REDIR_OVERFLOW)
771 0 0 if (length $self->headers->as_string > $OVERFLOW)