OpenInteract2/Setup/ReadPackages.pm

filter: Statementstmt 72.4% 21 / 29 Branchbran n/a Conditioncond 0.0% 0 / 5 MC/DCmcdc 0.0% 0 / 3 Subroutinesub 87.5% 7 / 8 Podpod 0.0% 0 / 3 totaltotal 58.3% 28 / 48 CC 3 SCAR 14.6
CC
3
Cov
62%
execute
12.0
BEGIN
1.0
BEGIN
1.0
CRAP 4.3
« OpenInteract2/Setup/RegisterRequestAndResponse.pm ↑ Summary OpenInteract2/Setup/InitializeTimezone.pm »
1 package OpenInteract2::Setup::ReadPackages;
2  
3 # $Id: ReadPackages.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::Constants qw( :log );
Subroutine BEGIN: called CC=1 SCAR=0.0
9 87 ▶use OpenInteract2::Exception qw( oi_error );
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 87 $OpenInteract2::Setup::ReadPackages::VERSION = sprintf("%d.%02d", q$Revision: 1.2 $ =~ /(\d+)\.(\d+)/);
12  
13 87 my ( $log );
14  
15 87 ▶sub get_name {
Subroutine get_name: called CC=1 SCAR=0.0
Pod undocumented
16 87 return 'read packages';
17 }
18  
19 1 ▶sub get_dependencies {
Subroutine get_dependencies: called CC=1 SCAR=0.0
Pod undocumented
20 1 return ( 'read repository' );
21 }
22  
23 0 ▶sub execute {
Subroutine execute: not called CC=3 SCAR=24.8
Pod undocumented
24 0 my ( $self, $ctx ) = @_;
25 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
26 0 my $repos = $ctx->repository;
27 0 $log->info( "Retrieving packages from repository with ",
28 "'", $repos->website_dir, "'" );
29 0 ▶ my $packages = $repos->fetch_all_packages || [];
Condition0%0/2
$repos->fetch_all_packages || []
l!l
00
MC/DC0%0/1
$repos->fetch_all_packages || []
$repos->fetch_all_packages
Truth table0%0/2
A
A= $repos->fetch_all_packages
Aresult
11
00
30 0 $log->info( "Fetched '", scalar( @{ $packages } ), "' from repository" );
31 0 $ctx->packages( $packages );
32 }
33  
34 87 OpenInteract2::Setup->register_factory_type( get_name() => __PACKAGE__ );
35  
36 87 1;
37  
38 __END__
« OpenInteract2/Setup/RegisterRequestAndResponse.pm ↑ Summary OpenInteract2/Setup/InitializeTimezone.pm »