Recipes/Delete.pm

filter: Statementstmt 70.0% 14 / 20 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 66.6% 4 / 6 Podpod 100% 2 / 2 totaltotal 71.4% 20 / 28 CC 1 SCAR 2.9
CC
1
Cov
70%
info_complete
2.0
finalize
2.0
BEGIN
1.0
CRAP 1.3
« Recipes/Cache.pm ↑ Summary Recipes/Default.pm »
1 package CGI::Ex::Recipes::Delete;
2  
3 1 ▶use utf8;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 1 ▶use base qw(CGI::Ex::Recipes);
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 1 our $VERSION = '0.03';
9  
10  
11 0 ▶sub info_complete { 1 }
Subroutine info_complete: not called CC=1 SCAR=6.9
Pod documented
12  
13 0 ▶sub finalize {
Subroutine finalize: not called CC=1 SCAR=6.9
Pod documented
14 0 my $self = shift;
15 0 $self->dbh->prepare("DELETE FROM recipes WHERE id = ?")->execute($self->form->{'id'});
16  
17 0 $self->add_to_form(success => "Recipe deleted from the database");
18 #make so default page displays the category in which this item is
19 0 $self->form->{'id'} = $self->form->{step_args}{'pid'};
20 0 return 1;
21 }
22  
23 1 1; # End of CGI::Ex::Recipes::Delete
24  
25 __END__
« Recipes/Cache.pm ↑ Summary Recipes/Default.pm »