Branch Coverage

blib/lib/CGI/Snapp/Dispatch.pm
Criterion Covered Total %
branch 104 136 76.4


line true false branch
33 0 2 if $#args > 0 and $#args % 2 != 1
35 0 2 ref $args[0] eq 'HASH' ? :
38 0 2 if not $$args{'table'} or ref $$args{'table'} ne 'ARRAY'
49 0 2 unless $$named_args{'app'}
50 0 2 if $$named_args{'rm'} and not $$named_args{'rm'} =~ /^([a-zA-Z_][\w\']+)$/
60 2 0 unless $$args_to_new{'QUERY'}
63 0 2 if $rm
69 0 0 $_ =~ /^404/ ? :
70 0 0 $error == 404 ? :
85 1 26 if not defined $path_info or length $path_info == 0
89 1 26 if not defined $path_info or $path_info eq '/'
90 2 25 if not defined $path_info or length $path_info == 0
94 3 24 if index($path_info, '/') != 0
95 24 3 if substr($path_info, -1) ne '/'
111 0 28 if $#args > 0 and $#args % 2 != 1
113 0 28 ref $args[0] eq 'HASH' ? :
116 0 28 if not $$args{'table'} or ref $$args{'table'} ne 'ARRAY'
120 3 25 if $self->return_type == 1
130 1 24 unless $$named_args{'app'}
131 1 23 if $$named_args{'rm'} and not $$named_args{'rm'} =~ /^([a-zA-Z_][\w\']+)$/
133 3 20 if ($self->return_type == 2) { }
149 17 2 if $rm
159 0 6 if not $error
162 6 19 $error ? :
195 3 3 unless $error_number =~ /^\d+/
202 2 4 if $error_document
214 0 6 if ($url) { }
229 4 2 unless $output
248 5 1 $output =~ /^(?:
253 6 0 if length $output < 520
280 0 627 unless defined $level
282 0 627 if $self->logger
303 24 12 if ($key eq 'args_to_new') { }
313 3 24 if (ref $$args{$key}{$sub_key} eq 'HASH') { }
317 1 2 if (exists $$extra_args{$key}{$sub_key}) { }
328 24 0 defined $$args{$key}{$sub_key} ? :
346 24 75 if (ref $$extra_args{$key} eq 'HASH') { }
350 18 6 if (exists $$final_args{$key}) { }
354 3 15 if ($$final_args{$key}{'PARAMS'}) { }
356 1 2 if (exists $$extra_args{$key}{'PARAMS'})
375 68 7 unless exists $$args{$key}
410 1 1 if (index($s, '"') == 0) { }
1 0 elsif (index($s, '<') == 0) { }
426 0 1 if $doc_root
430 1 0 if (-f $s and open INX, '<', $s) { }
450 0 2 if $url
451 2 0 if $output
473 0 71 unless defined $rule
482 3 68 if ($rule =~ /$request_method_regexp/)
486 1 2 if lc $http_method ne lc $1
497 69 1 if index($rule, '/') != 0
498 67 3 if substr($rule, -1) ne '/'
516 8 75 $4 ? :
522 9 61 if ($rule =~ m[/\*/$])
535 25 45 if (my(@values) = $path_info =~ /^$rule$/)
540 22 3 if @names
564 0 22 unless defined $module
565 4 18 unless defined $rm
569 1 21 if ($$named_args{'*'})
588 22 0 unless ($args_to_new)
595 0 22 unless $args_to_new
598 17 5 if $prefix
599 0 22 defined $$named_args{'auto_rest'} ? :
601 2 20 if ($auto_rest)
603 0 2 defined $$named_args{'auto_rest_lc'} ? :
604 1 1 if $method_lc
605 2 0 length $rm ? :
612 21 1 if (is_class_loaded($module)) { }