Articulate/Routes/TransparentForms.pm

filter: Statementstmt 60.6% 20 / 33 Branchbran 0.0% 0 / 2 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 62.5% 5 / 8 Podpod n/a totaltotal 52.0% 25 / 48 CC 3 SCAR 15.0
CC
3
Cov
53%
__ANON__
12.0
__ANON__
2.0
__ANON__
2.0
CRAP 4.5
« Articulate/Response.pm ↑ Summary Articulate/Service/Login.pm »
1 package Articulate::Routes::TransparentForms;
2 6 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 6 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 6 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 6 with 'Articulate::Role::Routes';
7 6 ▶use Articulate::Syntax::Routes;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 6 ▶use Articulate::Service;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 0 ▶get '/zone/:zone_id/create' => sub {
Subroutine __ANON__: not called CC=1 SCAR=6.9
11 0 my ( $self, $request ) = @_;
12 0 my $zone_id = $request->params->{'zone_id'};
13 0 $self->service->process_request(
14 create_form => {
15 location => "zone/$zone_id",
16 }
17 );
18 6 };
19  
20 0 ▶post '/zone/:zone_id/create' => sub {
Subroutine __ANON__: not called CC=3 SCAR=24.8
21 0 my ( $self, $request ) = @_;
22 0 my $zone_id = $request->params->{'zone_id'};
23 0 my $article_id = $request->params->{'article_id'};
24 0 ▶ return $self->process_request(
Branch: 1 branch
BranchTrueFalseTotal
unless defined $article_id and $article_id ne "" 0 0 0
Condition0%0/3
defined $article_id and $article_id ne ""
!ll&&!rl&&r
000
MC/DC0%0/2
defined $article_id and $article_id ne ""
defined $article_id $article_id ne ""
Truth table0%0/3
A and B
A= defined $article_idB= $article_id ne ""
ABresult
0X0
100
111
25 error => {
26 simple_message => 'Parameter article_id is required'
27 }
28 ) unless defined $article_id and $article_id ne '';
29 0 my $content = $request->params->{'content'};
30 0 $self->service->process_request(
31 create => {
32 location => "zone/$zone_id/article/$article_id",
33 content => $content,
34 }
35 );
36 6 };
37  
38 0 ▶get '/zone/:zone_id/article/:article_id/edit' => sub {
Subroutine __ANON__: not called CC=1 SCAR=6.9
39 0 my ( $self, $request ) = @_;
40 0 my $zone_id = $request->params->{'zone_id'};
41 0 my $article_id = $request->params->{'article_id'};
42 0 $self->service->process_request(
43 edit_form => {
44 location => "zone/$zone_id/article/$article_id",
45 }
46 );
47 6 };
48  
49 6 1;
« Articulate/Response.pm ↑ Summary Articulate/Service/Login.pm »