OpenInteract2/Setup/InitializeControllers.pm

filter: Statementstmt 72.9% 27 / 37 Branchbran 0.0% 0 / 2 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 90.0% 9 / 10 Podpod 0.0% 0 / 3 totaltotal 63.1% 36 / 57 CC 4 SCAR 19.2
CC
4
Cov
64%
execute
20.0
BEGIN
1.0
BEGIN
1.0
CRAP 6.8
« OpenInteract2/Manage/Website/ReindexObjects.pm ↑ Summary OpenInteract2/SessionManager/SQLite.pm »
1 package OpenInteract2::Setup::InitializeControllers;
2  
3 # $Id: InitializeControllers.pm,v 1.4 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::Constants qw( LOG_INIT );
Subroutine BEGIN: called CC=1 SCAR=0.0
9 87 ▶use OpenInteract2::Controller;
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 87 ▶use OpenInteract2::Util;
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 87 $OpenInteract2::Setup::InitializeControllers::VERSION = sprintf("%d.%02d", q$Revision: 1.4 $ =~ /(\d+)\.(\d+)/);
14  
15 87 my ( $log );
16  
17 87 ▶sub get_name {
Subroutine get_name: called CC=1 SCAR=0.0
Pod undocumented
18 87 return 'initialize controllers';
19 }
20  
21 1 ▶sub get_dependencies {
Subroutine get_dependencies: called CC=1 SCAR=0.0
Pod undocumented
22 1 return ( 'initialize actions' );
23 }
24  
25 0 ▶sub execute {
Subroutine execute: not called CC=4 SCAR=30.0
Pod undocumented
26 0 my ( $self, $ctx ) = @_;
27 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
28 0 my $controllers = $ctx->lookup_controller_config;
29 0 ▶ while ( my ( $name, $info ) = each %{ $controllers } ) {
Branch: 1 branch
BranchTrueFalseTotal
if (() = each %{$controllers;}) 0 0 0
30 0 OpenInteract2::Controller->register_factory_type( $name => $info->{class} );
31 }
32 0 my @observers = OpenInteract2::Util->find_factory_subclasses(
33 'OpenInteract2::Observer::Controller',
34 );
35 0 foreach my $observer ( @observers ) {
36 0 OpenInteract2::Controller->add_observer( $observer );
37 0 $log->info( "Added observer '$observer' to the controller" );
38 }
39 }
40  
41 87 OpenInteract2::Setup->register_factory_type( get_name() => __PACKAGE__ );
42  
43 87 1;
44  
45 __END__
« OpenInteract2/Manage/Website/ReindexObjects.pm ↑ Summary OpenInteract2/SessionManager/SQLite.pm »