Branch Coverage

blib/lib/Rubric/WebApp.pm
Criterion Covered Total %
branch 42 132 31.8


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')
534 0 0 unless $user
536 0 0 unless $reset_code
538 0 0 if (my $password = $user->reset_password($reset_code)) { }
571 0 0 unless $self->param('current_user')
573 0 0 unless my(%prefs) = $self->_get_prefs_form
576 0 0 if (my(%errors) = $self->validate_prefs(\%prefs))
593 0 0 if $$prefs{'password_1'}
605 0 0 if $self->query->param($_)
649 0 0 if (not $$prefs{'email'}) { }
0 0 elsif ($$prefs{'email'} and not $$prefs{'email'} =~ /$Email::Address::addr_spec/) { }
656 0 0 if ($$prefs{'password_1'} and $$prefs{'password_2'} and $$prefs{'password_1'} ne $$prefs{'password_2'})
665 0 0 if (not $$prefs{'password'}) { }
0 0 elsif (md5_hex($$prefs{'password'}) ne $self->param('current_user')->password) { }
689 0 1 if 'Rubric::Config'->registration_closed
692 0 1 if $self->param('current_user')
700 1 0 if (%errors) { }
720 0 1 if ($$newuser{'username'} and not $$newuser{'username'} =~ /^[\pL\d_.]+$/) { }
0 1 elsif ('Rubric::User'->retrieve($$newuser{'username'})) { }
728 1 0 if (not $$newuser{'email'}) { }
0 0 elsif ($$newuser{'email'} and not $$newuser{'email'} =~ /$Email::Address::addr_spec/) { }
735 0 0 if ($$newuser{'password_1'} and $$newuser{'password_2'} and $$newuser{'password_1'} ne $$newuser{'password_2'})
764 0 0 unless ('Rubric::Config'->skip_newuser_verification)
820 0 0 if $self->param('current_user')
826 0 0 if defined $user and $user eq ''
829 0 0 $user->verify($code) ? :
882 0 0 if defined $self->param('user') and $self->param('user') eq ''
923 29 1 if $iterator->count % $self->param('per_page')
965 0 1 unless $self->get_entry
968 0 1 unless $self->param('entry')->user eq $self->param('current_user')
1002 0 10 unless $ok
1003 10 0 if $ok
1007 0 2 if $@
1009 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;}))
1020 0 2 if $@
1022 0 2 if $self->query->param('submit') and not length $form{'title'}
1025 1 1 if ($form{'uri'} and 'Rubric::Config'->one_entry_per_link)
1026 0 1 if (my($link) = 'Rubric::Link'->search({'uri', $form{'uri'}}))
1028 0 0 if (my($entry) = $self->param('current_user')->entries('link', $link))
1043 0 2 unless my $user = $self->param('current_user')
1047 0 0 if not $self->query->param('submit') or %$error or not my $entry = $self->param('current_user')->quick_entry($form)
1055 0 0 if ($when_done eq 'close') { }
0 0 elsif ($when_done eq 'entry') { }
0 0 elsif ($when_done eq 'go_back') { }
1099 0 1 unless my $user = $self->param('current_user')
1101 0 1 unless $self->get_entry
1104 0 1 unless $self->param('entry')->user eq $user
1128 1 0 $output ? :
1141 1 0 $doc_page =~ /^[\pL\d_]+$/ ? :