WE_Sample/HW.pm

filter: Statementstmt 46.1% 12 / 26 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 66.6% 4 / 6 Podpod n/a totaltotal 47.0% 16 / 34 CC 2 SCAR 9.4
CC
2
Cov
43%
identify
6.0
new
2.0
BEGIN
1.0
CRAP 2.6
« WebEditor/OldFeatures/IndexerLive.pm ↑ Summary WE_Frontend/Plugin/Benchmark.pm »
1 # -*- perl -*-
2  
3 #
4 # $Id: HW.pm,v 1.3 2003/01/16 14:29:11 eserte Exp $
5 # Author: Slaven Rezic
6 #
7 # Copyright (C) 2001 Online Office Berlin. All rights reserved.
8 # Copyright (C) 2002 Slaven Rezic.
9 # This is free software; you can redistribute it and/or modify it under the
10 # terms of the GNU General Public License, see the file COPYING.
11  
12 #
13 # Mail: slaven@rezic.de
14 # WWW: http://we-framework.sourceforge.net
15 #
16  
17 package WE_Sample::HW;
18  
19 $^W = 0; # XXX too much problems with HyperWave::CSP
20  
21 1 ▶use base qw(WE::DB);
Subroutine BEGIN: called CC=1 SCAR=0.0
22 1 ▶use WE::Obj;
Subroutine BEGIN: called CC=1 SCAR=0.0
23  
24 WE::DB->use_databases(qw/HWObj HWContent/);
25 WE::Obj->use_classes(':all');
26  
27 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
28 1 ▶use vars qw($VERSION);
Subroutine BEGIN: called CC=1 SCAR=0.0
29 $VERSION = sprintf("%d.%02d", q$Revision: 1.3 $ =~ /(\d+)\.(\d+)/);
30  
31 0 ▶sub new {
Subroutine new: not called CC=1 SCAR=6.9
32 0 my($class, $hwhost, $hwport, %args) = @_;
33 0 my $self = {};
34 0 bless $self, $class;
35  
36 0 $self->ObjDB(WE::DB::HWObj->new($self,
37 -hwhost => $hwhost,
38 -hwport => $hwport,
39 %args,
40 ));
41 0 $self->ContentDB(WE::DB::HWContent->new($self));
42 0 $self;
43 }
44  
45 0 ▶sub identify {
Subroutine identify: not called CC=2 SCAR=17.9
46 0 my($self, $user, $pw) = @_;
47 0 my $objdb = $self->ObjDB;
48 0 my $server = HyperWave::CSP->new($objdb->HWHost, $objdb->HWPort,
49 $user, $pw);
50 0 ▶ if ($server) {
Branch: 1 branch
BranchTrueFalseTotal
if ($server) { } 0 0 0
51 0 $objdb->HW($server);
52 0 $self->CurrentUser($user);
53 0 1;
54 } else {
55 0 0;
56 }
57 }
58  
59 1;
60  
61 __END__
« WebEditor/OldFeatures/IndexerLive.pm ↑ Summary WE_Frontend/Plugin/Benchmark.pm »