Branch Coverage

blib/lib/Rubric/WebApp.pm
Criterion Covered Total %
branch 43 132 32.5


line true false branch
113 0 48 unless eval "require $login_class; 1"
165 0 48 if $self->session->param("per_page") > "Rubric::Config"->max_page_size
196 40 2 unless $type and $type =~ /^[\pL\d_]+$/
220 48 0 if ($self->param("current_user") or not "Rubric::Config"->private_system)
232 4 1 if (substr($runmode, 0, 1) eq "~")
245 1 3 if @$path % 2
263 0 30 unless eval "require $entries_class"
279 0 2 unless $entry
282 0 0 if grep {$_ eq "Rubric::Config"->private_tag;} $entry->tags and !$self->param('current_user') || $entry->user ne $self->param('current_user')
318 0 0 unless $self->get_link
336 0 0 unless $search{$_}
338 0 0 unless %search
339 0 0 unless my($link) = "Rubric::Link"->search(\%search)
383 1 0 unless ($year or $month)
448 0 1 unless ($prev_month)
456 0 1 if ($next_month > 12)
486 2 3 if ($self->param("current_user"))
492 0 3 if ($self->get_current_runmode ne "login")
497 0 3 if ("Rubric::Config"->secure_login)
498 0 0 if ($self->query->env->{'psgi.url_scheme'} ne "https")
541 0 0 unless $user
543 0 0 unless $reset_code
545 0 0 if (my $password = $user->reset_password($reset_code)) { }
578 0 0 unless $self->param("current_user")
580 0 0 unless my(%prefs) = $self->_get_prefs_form
583 0 0 if (my(%errors) = $self->validate_prefs(\%prefs))
600 0 0 if $prefs->{'password_1'}
612 0 0 if $self->query->param($_)
656 0 0 if (not $prefs->{'email'}) { }
0 0 elsif ($prefs->{'email'} and not $prefs->{'email'} =~ /$Email::Address::addr_spec/) { }
663 0 0 if ($prefs->{'password_1'} and $prefs->{'password_2'} and $prefs->{'password_1'} ne $prefs->{'password_2'})
672 0 0 $prefs->{'password'} ? :
696 0 1 if "Rubric::Config"->registration_closed
699 0 1 if $self->param("current_user")
707 1 0 if (%errors) { }
727 0 1 if ($newuser->{'username'} and not $newuser->{'username'} =~ /^[\pL\d_.]+$/) { }
0 1 elsif ('Rubric::User'->retrieve($newuser->{'username'})) { }
735 0 1 $newuser->{'email'} ? :
742 0 0 if ($newuser->{'password_1'} and $newuser->{'password_2'} and $newuser->{'password_1'} ne $newuser->{'password_2'})
771 0 0 unless ("Rubric::Config"->skip_newuser_verification)
827 0 0 if $self->param("current_user")
833 0 0 if defined $user and $user eq ""
836 0 0 $user->verify($code) ? :
889 0 0 if defined $self->param("user") and $self->param("user") eq ""
930 29 1 if $iterator->count % $self->param("per_page")
972 0 1 unless $self->get_entry
975 0 1 unless $self->param("entry")->user eq $self->param("current_user")
1009 0 10 unless $ok
1010 10 0 if $ok
1014 0 2 if $@
1016 0 1 if ($form{'uri'} and not $error{'uri'} and defined "Rubric::Config"->allowed_schemes and not grep({$_ eq $form{'uri'}->scheme;} @{"Rubric::Config"->allowed_schemes;}))
1027 0 2 if $@
1030 0 2 if $self->query->param("submit") and not length $form{'title'}
1032 1 1 if ($form{'uri'} and "Rubric::Config"->one_entry_per_link)
1033 0 1 if (my($link) = "Rubric::Link"->search({"uri", $form{'uri'}}))
1035 0 0 if (my($entry) = $self->param("current_user")->entries("link", $link))
1050 0 2 unless my $user = $self->param("current_user")
1054 0 0 if not $self->query->param("submit") or %$error or not my $entry = $self->param("current_user")->quick_entry($form)
1062 0 0 if ($when_done eq 'close') { }
0 0 elsif ($when_done eq 'entry') { }
0 0 elsif ($when_done eq 'go_back') { }
1106 0 1 unless my $user = $self->param("current_user")
1108 0 1 unless $self->get_entry
1111 0 1 unless $self->param("entry")->user eq $user
1135 1 0 $output ? :
1148 1 0 $doc_page =~ /^[\pL\d_]+$/ ? :