ZofCMS/Output.pm

filter: Statementstmt 30.5% 11 / 36 Branchbran 0.0% 0 / 8 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 33.3% 3 / 9 Podpod 0.0% 0 / 6 totaltotal 21.8% 14 / 64 CC 6 SCAR 17.3
CC
6
Cov
23%
headers
12.0
config
6.0
conf
6.0
CRAP 5.6
« ZofCMS/Plugin/Sub.pm ↑ Summary ZofCMS/Test/Plugin.pm »
1  
2 package App::ZofCMS::Output;
3  
4 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 2 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 2 our $VERSION = '1.001010'; # VERSION
9  
10 0 ▶sub new {
Subroutine new: not called CC=1 SCAR=6.9
Pod undocumented
11 0 my ( $class, $config, $template ) = @_;
12 0 my $self = bless {}, $class;
13 0 $self->config( $config );
14 0 $self->conf( $config->conf );
15 0 $self->template( $template );
16 0 return $self;
17 }
18  
19 0 ▶sub headers {
Subroutine headers: not called CC=3 SCAR=24.8
Pod undocumented
20 0 my $self = shift;
21 0 my $query = $self->config->query;
22 0 ▶ if ( $query->{dir} eq '/' and $query->{page} eq '404' ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($query->{"dir"} eq "/" and $query->{"page"} eq 404) 0 0 0
Condition0%0/3
$query->{"dir"} eq "/" and $query->{"page"} eq 404
!ll&&!rl&&r
000
MC/DC0%0/2
$query->{"dir"} eq "/" and $query->{"page"} eq 404
$query->{"dir"} eq "/" $query->{"page"} eq 404
Truth table0%0/3
A and B
A= $query->{"dir"} eq "/"B= $query->{"page"} eq 404
ABresult
0X0
100
111
23 0 return $self->config->cgi->header('text/html','404 Not Found');
24 }
25 0 return $self->config->cgi->header( -type => 'text/html', -charset => 'utf-8' );
26 }
27  
28 0 ▶sub output {
Subroutine output: not called CC=1 SCAR=6.9
Pod undocumented
29 0 my $self = shift;
30  
31 0 return $self->template->html_template->output;
32 }
33  
34 0 ▶sub config {
Subroutine config: not called CC=2 SCAR=17.9
Pod undocumented
35 0 my $self = shift;
36 0 ▶ if ( @_ ) {
Branch: 1 branch
BranchTrueFalseTotal
if (@_) 0 0 0
37 0 $self->{ config } = shift;
38 }
39 0 return $self->{ config };
40 }
41  
42  
43 0 ▶sub conf {
Subroutine conf: not called CC=2 SCAR=17.9
Pod undocumented
44 0 my $self = shift;
45 0 ▶ if ( @_ ) {
Branch: 1 branch
BranchTrueFalseTotal
if (@_) 0 0 0
46 0 $self->{ conf } = shift;
47 }
48 0 return $self->{ conf };
49 }
50  
51  
52 0 ▶sub template {
Subroutine template: not called CC=2 SCAR=17.9
Pod undocumented
53 0 my $self = shift;
54 0 ▶ if ( @_ ) {
Branch: 1 branch
BranchTrueFalseTotal
if (@_) 0 0 0
55 0 $self->{ template } = shift;
56 }
57 0 return $self->{ template };
58 }
59  
60  
61 2 1;
62 __END__
« ZofCMS/Plugin/Sub.pm ↑ Summary ZofCMS/Test/Plugin.pm »