blib/lib/Eobj/site_init.pl

filter: Statementstmt 71.4% 5 / 7 Branchbran 50.0% 3 / 6 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 1 / 1 Podpod n/a totaltotal 64.2% 9 / 14 CC 4 SCAR 15.9
CC
4
Cov
62%
init
4.9
CRAP 4.9
« blib/lib/Eobj.pm ↑ Summary blib/lib/Eobj/PLerror.pm »
1 #
2 # This file is part of the Eobj project.
3 #
4 # Copyright (C) 2003, Eli Billauer
5 #
6 # This program is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 2 of the License, or
9 # (at your option) any later version.
10 #
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
15 #
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, write to the Free Software
18 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 #
20 # A copy of the license can be found in a file named "licence.txt", at the
21 # root directory of this project.
22 #
23  
24 # This class contains only one method -- init.
25 # It includes the initialization associated with this current
26 # site (application and user independent).
27  
28 ${__PACKAGE__.'::errorcrawl'}='system';
29  
30 1 ▶sub init {
Subroutine init: called CC=4 SCAR=15.9
31 1 my $user_init_flag = 0;
32  
33 1 ▶ if (-e 'init.pl') { # Per-project init?
Branch: 1 branch
BranchTrueFalseTotal
if (-e "init.pl") 0 1 1
34 0 &Eobj::inherit('user_init','init.pl','PL_hardroot');
35 0 $user_init_flag = 1;
36 }
37  
38 1 ▶ blow("init() called more than once")
Branch: 1 branch
BranchTrueFalseTotal
if defined $Eobj::globalobject 0 1 1
39 if (defined $Eobj::globalobject);
40 1 $Eobj::globalobject = global -> new(name => 'globalobject');
41
42 1 ▶ user_init->init() if $user_init_flag;
Branch: 1 branch
BranchTrueFalseTotal
if $user_init_flag 0 1 1
43 }
« blib/lib/Eobj.pm ↑ Summary blib/lib/Eobj/PLerror.pm »