OpenInteract2/Setup/RegisterActionTypes.pm

filter: Statementstmt 68.5% 24 / 35 Branchbran 0.0% 0 / 4 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 88.8% 8 / 9 Podpod 0.0% 0 / 3 totaltotal 57.1% 32 / 56 CC 4 SCAR 19.9
CC
4
Cov
57%
execute
20.0
BEGIN
1.0
BEGIN
1.0
CRAP 7.3
« OpenInteract2/Request/Apache.pm ↑ Summary OpenInteract2/Config/Package.pm »
1 package OpenInteract2::Setup::RegisterActionTypes;
2  
3 # $Id: RegisterActionTypes.pm,v 1.2 2005/03/18 04:09:51 lachoy Exp $
4  
5 87 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 87 ▶use base qw( OpenInteract2::Setup );
Subroutine BEGIN: called CC=1 SCAR=0.0
7 87 ▶use Log::Log4perl qw( get_logger );
Subroutine BEGIN: called CC=1 SCAR=0.0
8 87 ▶use OpenInteract2::Action;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 87 ▶use OpenInteract2::Constants qw( :log );
Subroutine BEGIN: called CC=1 SCAR=0.0
10 87 ▶use OpenInteract2::Exception qw( oi_error );
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12 87 $OpenInteract2::Setup::RegisterActionTypes::VERSION = sprintf("%d.%02d", q$Revision: 1.2 $ =~ /(\d+)\.(\d+)/);
13  
14 87 my ( $log );
15  
16 87 ▶sub get_name {
Subroutine get_name: called CC=1 SCAR=0.0
Pod undocumented
17 87 return 'register action types';
18 }
19  
20 1 ▶sub get_dependencies {
Subroutine get_dependencies: called CC=1 SCAR=0.0
Pod undocumented
21 1 return ( 'read packages' );
22 }
23  
24 0 ▶sub execute {
Subroutine execute: not called CC=4 SCAR=30.0
Pod undocumented
25 0 my ( $self, $ctx ) = @_;
26 0 my $action_types = $ctx->server_config->{action_types};
27 0 ▶ return [] unless ( ref $action_types eq 'HASH' );
Branch: 1 branch
BranchTrueFalseTotal
unless ref $action_types eq "HASH" 0 0 0
28  
29 0 ▶ $log ||= get_logger( LOG_INIT );
Condition0%0/3
$log ||= get_logger("OI2.INITIALIZE")
l!l&&r!l&&!r
000
MC/DC0%0/2
$log ||= get_logger("OI2.INITIALIZE")
$log get_logger("OI2.INITIALIZE")
Truth table0%0/3
A ||= B
A= $logB= get_logger("OI2.INITIALIZE")
ABresult
1X1
011
000
30 0 my @classes = ();
31 0 ▶ while ( my ( $type, $class ) = each %{ $action_types } ) {
Branch: 1 branch
BranchTrueFalseTotal
if (() = each %{$action_types;}) 0 0 0
32 0 OpenInteract2::Action->register_factory_type( $type, $class );
33 0 $log->info( "Registered action type $type => $class" );
34 0 push @classes, $class;
35 }
36 0 $self->param( registered => \@classes );
37 }
38  
39 87 OpenInteract2::Setup->register_factory_type( get_name() => __PACKAGE__ );
40  
41 87 1;
42  
43 __END__
« OpenInteract2/Request/Apache.pm ↑ Summary OpenInteract2/Config/Package.pm »