Articulate/Routes/TransparentPreviews.pm

filter: Statementstmt 75.0% 18 / 24 Branchbran 0.0% 0 / 2 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 83.3% 5 / 6 Podpod n/a totaltotal 62.1% 23 / 37 CC 3 SCAR 16.3
CC
3
Cov
62%
__ANON__
12.0
BEGIN
1.0
BEGIN
1.0
CRAP 5.1
« Articulate/Service/Error.pm ↑ Summary Articulate/Response.pm »
1 package Articulate::Routes::TransparentPreviews;
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 ▶post '/zone/:zone_id/preview' => sub {
Subroutine __ANON__: not called CC=3 SCAR=24.8
11 0 my ( $self, $request ) = @_;
12 0 my $zone_id = $request->params->{'zone_id'};
13 0 my $article_id = $request->params->{'article_id'};
14 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
15 error => {
16 simple_message => 'Parameter article_id is required'
17 }
18 ) unless defined $article_id and $article_id ne '';
19 0 my $content = $request->params->{'content'};
20 0 $self->process_request(
21 preview => {
22 location => "zone/$zone_id/article/$article_id",
23 content => $content,
24 }
25 );
26 6 };
27  
28 6 1;
« Articulate/Service/Error.pm ↑ Summary Articulate/Response.pm »