| 1 | package Wishlist::Controller::List; | ||||||||||
| 2 | 2 | ▶ | use Mojo::Base 'Mojolicious::Controller'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 3 | |||||||||||
| 4 | 1 | ▶ | sub show_add { | ||||||||
|
Subroutine
show_add: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 5 | 1 | my $c = shift; | |||||||||
| 6 | 1 | ▶ | $c->link($c->param('url'), sub { | ||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||
| 7 | 1 | my $link = $_[1]; | |||||||||
| 8 | 1 | $c->render('add', link => $link); | |||||||||
| 9 | 1 | }); | |||||||||
| 10 | } | ||||||||||
| 11 | |||||||||||
| 12 | 0 | ▶ | sub do_add { | ||||||||
|
Subroutine
do_add: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 13 | 0 | my $c = shift; | |||||||||
| 14 | 0 | my %item = ( | |||||||||
| 15 | title => $c->param('title'), | ||||||||||
| 16 | url => $c->param('url'), | ||||||||||
| 17 | purchased => 0, | ||||||||||
| 18 | ); | ||||||||||
| 19 | 0 | $c->model->add_item($c->user, \%item); | |||||||||
| 20 | 0 | $c->redirect_to('/'); | |||||||||
| 21 | } | ||||||||||
| 22 | |||||||||||
| 23 | 0 | ▶ | sub update { | ||||||||
|
Subroutine
update: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||
| 24 | 0 | my $c = shift; | |||||||||
| 25 | 0 | $c->model->update_item( | |||||||||
| 26 | {id => $c->param('id')}, | ||||||||||
| 27 | $c->param('purchased') | ||||||||||
| 28 | ); | ||||||||||
| 29 | 0 | ▶ | if (my $url = $c->param('next_url')) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 30 | 0 | return $c->redirect_to($url); | |||||||||
| 31 | } | ||||||||||
| 32 | 0 | return $c->redirect_to('/'); | |||||||||
| 33 | } | ||||||||||
| 34 | |||||||||||
| 35 | 0 | ▶ | sub remove { | ||||||||
|
Subroutine
remove: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 36 | 0 | my $c = shift; | |||||||||
| 37 | 0 | $c->model->remove_item( | |||||||||
| 38 | {id => $c->param('id')}, | ||||||||||
| 39 | ); | ||||||||||
| 40 | 0 | $c->redirect_to('/'); | |||||||||
| 41 | } | ||||||||||
| 42 | |||||||||||
| 43 | 2 | 1; | |||||||||
| 44 | |||||||||||