OpenInteract2/Manage/Website/ViewSession.pm

filter: Statementstmt 68.5% 24 / 35 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 72.7% 8 / 11 Podpod 0.0% 0 / 5 totaltotal 60.3% 32 / 53 CC 2 SCAR 6.9
CC
2
Cov
65%
run_task
6.0
get_brief_description
2.0
list_param_require
2.0
CRAP 2.0
« OpenInteract2/Manage/Website/CreateSecurity.pm ↑ Summary OpenInteract2/Exception/Parameter.pm »
1 package OpenInteract2::Manage::Website::ViewSession;
2  
3 # $Id: ViewSession.pm,v 1.11 2005/03/17 14:58:04 sjn Exp $
4  
5 87 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 87 ▶use base qw( OpenInteract2::Manage::Website );
Subroutine BEGIN: called CC=1 SCAR=0.0
7 87 ▶use Data::Dumper qw( Dumper );
Subroutine BEGIN: called CC=1 SCAR=0.0
8 87 ▶use OpenInteract2::Context qw( CTX );
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 87 ▶use OpenInteract2::SessionManager;
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12  
13 87 $OpenInteract2::Manage::Website::ViewSession::VERSION = sprintf("%d.%02d", q$Revision: 1.11 $ =~ /(\d+)\.(\d+)/);
14  
15 87 ▶sub get_name {
Subroutine get_name: called CC=1 SCAR=0.0
Pod undocumented
16 87 'view_session';
17 }
18  
19 0 ▶sub get_brief_description {
Subroutine get_brief_description: not called CC=1 SCAR=6.9
Pod undocumented
20 0 return 'View the contents of a particular session';
21 }
22  
23 0 ▶sub list_param_require { return [ 'session_id', 'website_dir' ] }
Subroutine list_param_require: not called CC=1 SCAR=6.9
Pod undocumented
24  
25 1 ▶sub get_parameters {
Subroutine get_parameters: called CC=1 SCAR=0.0
Pod undocumented
26 1 my ( $self ) = @_;
27 return {
28 1 website_dir => $self->_get_website_dir_param,
29 session_id => {
30 description => 'ID of session to view',
31 is_required => 'yes',
32 },
33 };
34 }
35  
36 0 ▶sub run_task {
Subroutine run_task: not called CC=2 SCAR=17.9
Pod undocumented
37 0 my ( $self ) = @_;
38 0 my $session_id = $self->param( 'session_id' );
39  
40 0 my $session = OpenInteract2::SessionManager->create( $session_id );
41 0 my $action = 'view session';
42 0 my %status = ( session_id => $session_id );
43 0 ▶ if ( $@ ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($@) { } 0 0 0
44 0 $self->_fail( $action, "Caught error trying to tie session: $@",
45 session_id => $session_id );
46 }
47 else {
48 0 local $Data::Dumper::Indent = 1;
49 0 $self->_ok( $action,
50 "Contents of session:\n" . Dumper( $session ),
51 session_id => $session_id );
52 }
53 }
54  
55 87 OpenInteract2::Manage->register_factory_type( get_name() => __PACKAGE__ );
56  
57 87 1;
58  
59 __END__
« OpenInteract2/Manage/Website/CreateSecurity.pm ↑ Summary OpenInteract2/Exception/Parameter.pm »