ZofCMS/Plugin/ConditionalRedirect.pm

filter: Statementstmt 50.0% 8 / 16 Branchbran 0.0% 0 / 4 Conditioncond 0.0% 0 / 6 MC/DCmcdc 0.0% 0 / 4 Subroutinesub 50.0% 2 / 4 Podpod 0.0% 0 / 2 totaltotal 27.7% 10 / 36 CC 5 SCAR 29.6
CC
5
Cov
31%
process
30.0
new
2.0
BEGIN
1.0
CRAP 19.2
« ZofCMS/Plugin/ConfigToTemplate.pm ↑ Summary ZofCMS/Plugin/InstalledModuleChecker.pm »
1 package App::ZofCMS::Plugin::ConditionalRedirect;
2  
3 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 1 our $VERSION = '1.001010'; # VERSION
7  
8 0 ▶sub new { bless {}, shift }
Subroutine new: not called CC=1 SCAR=6.9
Pod undocumented
9  
10 0 ▶sub process {
Subroutine process: not called CC=5 SCAR=34.0
Pod undocumented
11 0 my ( $self, $template, $query, $config ) = @_;
12 return
13 unless $template->{plug_redirect}
14 0 ▶ or $config->conf->{plug_redirect};
Branch: 1 branch
BranchTrueFalseTotal
unless $template->{"plug_redirect"} or $config->conf->{"plug_redirect"} 0 0 0
Condition0%0/3
$template->{"plug_redirect"} or $config->conf->{"plug_redirect"}
l!l&&r!l&&!r
000
MC/DC0%0/2
$template->{"plug_redirect"} or $config->conf->{"plug_redirect"}
$template->{"plug_redirect"} $config->conf->{"plug_redirect"}
Truth table0%0/3
A or B
A= $template->{"plug_redirect"}B= $config->conf->{"plug_redirect"}
ABresult
1X1
011
000
15  
16 0 ▶ my $sub = delete $template->{plug_redirect} || delete $config->conf->{plug_redirect};
Condition0%0/3
delete $template->{'plug_redirect'} || delete $config->conf->{'plug_redirect'}
l!l&&r!l&&!r
000
MC/DC0%0/2
delete $template->{'plug_redirect'} || delete $config->conf->{'plug_redirect'}
delete $template->{'plug_redirect'} delete $config->conf->{'plug_redirect'}
Truth table0%0/3
A || B
A= delete $template->{'plug_redirect'}B= delete $config->conf->{'plug_redirect'}
ABresult
1X1
011
000
17  
18 0 my $uri = $sub->( $template, $query, $config );
19  
20 0 ▶ defined $uri
Branch: 1 branch
BranchTrueFalseTotal
defined $uri or return 0 0 0
21 or return;
22  
23 0 print $config->cgi->redirect($uri);
24 0 exit;
25 }
26  
27 1 1;
28 __END__
« ZofCMS/Plugin/ConfigToTemplate.pm ↑ Summary ZofCMS/Plugin/InstalledModuleChecker.pm »