OpenInteract2/Controller/Raw.pm

filter: Statementstmt 63.6% 21 / 33 Branchbran 0.0% 0 / 6 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 85.7% 6 / 7 Podpod 0.0% 0 / 1 totaltotal 51.9% 27 / 52 CC 5 SCAR 26.5
CC
5
Cov
50%
execute
30.0
BEGIN
1.0
BEGIN
1.0
CRAP 14.2
« OpenInteract2/ActionResolver/UserDir.pm ↑ Summary OpenInteract2/Manage/Website.pm »
1 package OpenInteract2::Controller::Raw;
2  
3 # $Id: Raw.pm,v 1.12 2005/03/17 14:58:01 sjn Exp $
4  
5 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 1 ▶use base qw( OpenInteract2::Controller );
Subroutine BEGIN: called CC=1 SCAR=0.0
7 1 ▶use Log::Log4perl qw( get_logger );
Subroutine BEGIN: called CC=1 SCAR=0.0
8 1 ▶use OpenInteract2::Context qw( CTX );
Subroutine BEGIN: called CC=1 SCAR=0.0
9 1 ▶use OpenInteract2::Constants qw( :log );
Subroutine BEGIN: called CC=1 SCAR=0.0
10 1 ▶use OpenInteract2::Exception qw( oi_error );
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12 1 $OpenInteract2::Controller::Raw::VERSION = sprintf("%d.%02d", q$Revision: 1.12 $ =~ /(\d+)\.(\d+)/);
13  
14 1 my ( $log );
15  
16 0 ▶sub execute {
Subroutine execute: not called CC=5 SCAR=34.0
Pod undocumented
17 0 my ( $self ) = @_;
18 0 ▶ $log ||= get_logger( LOG_ACTION );
Condition0%0/3
$log ||= get_logger("OI2.ACTION")
l!l&&r!l&&!r
000
MC/DC0%0/2
$log ||= get_logger("OI2.ACTION")
$log get_logger("OI2.ACTION")
Truth table0%0/3
A ||= B
A= $logB= get_logger("OI2.ACTION")
ABresult
1X1
011
000
19 0 my $action = $self->initial_action;
20 0 ▶ $log->is_debug &&
Branch: 1 branch
BranchTrueFalseTotal
$log->is_debug and $log->debug("Executing top-level action [", $action->name, "] ", "with task [", $action->task, "]") 0 0 0
21 $log->debug( 'Executing top-level action [', $action->name, "] ",
22 "with task [", $action->task, "]" );
23  
24 0 my $content = eval { $action->execute };
25 0 ▶ if ( $@ ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($@) { } 0 0 0
26 0 $log->error( "Caught exception generating content: $@" );
27 0 $content = $@;
28 }
29 else {
30 0 ▶ $log->is_debug &&
Branch: 1 branch
BranchTrueFalseTotal
$log->is_debug and $log->debug("Generated content ok") 0 0 0
31 $log->debug( "Generated content ok" );
32 }
33  
34 # We don't need no steenkeng content generator!
35 0 CTX->response->content( \$content );
36 0 return $self;
37 }
38  
39 1 1;
40  
41 __END__
« OpenInteract2/ActionResolver/UserDir.pm ↑ Summary OpenInteract2/Manage/Website.pm »