Room.pm

filter: Statementstmt 80.0% 32 / 40 Branchbran 30.0% 3 / 10 Conditioncond 33.3% 1 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 69.2% 9 / 13 Podpod 66.6% 4 / 6 totaltotal 66.2% 49 / 74 CC 7 SCAR 10.3
CC
7
Cov
68%
description
6.0
can_enter
6.0
clear
3.1
CRAP 2.8
« Usergroup.pm ↑ Summary Superdoc.pm »
1 # E2::Room.pm
2 # Jose M. Weeks <jose@joseweeks.com>
3 # 05 June 2003
4 #
5 # See bottom for pod documentation.
6  
7 package E2::Room;
8  
9 2 ▶use 5.006;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
11 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
12 2 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
13  
14 2 ▶use E2::Node;
Subroutine BEGIN: called CC=1 SCAR=0.0
15  
16 2 our @ISA = "E2::Node";
17 2 our $VERSION = "0.32";
18 2 our $DEBUG; *DEBUG = *E2::Interface::DEBUG;
19  
20 # Prototypes
21  
22 sub new;
23 sub clear;
24  
25 sub description;
26 sub can_enter;
27  
28 # Private
29  
30 sub type_as_string;
31 sub twig_handlers;
32  
33 # Object Methods
34  
35 1 ▶sub new {
Subroutine new: called CC=2 SCAR=7.2
Pod documented
36 1 my $arg = shift;
37 1 ▶ my $class = ref( $arg ) || $arg;
Condition33%1/3
ref $arg || $arg
l!l&&r!l&&!r
010
MC/DC0%0/2
ref $arg || $arg
ref $arg $arg
Truth table33%1/3
A || B
A= ref $argB= $arg
ABresult
1X1
011
000
38 1 my $self = $class->SUPER::new();
39  
40 # See clear for the other members of $self
41  
42 1 $self->clear;
43 1 return $self;
44 }
45  
46 3 ▶sub clear {
Subroutine clear: called CC=3 SCAR=11.3
Pod documented
47 3 ▶ my $self = shift or croak "Usage: clear E2USERGROUP";
Branch: 1 branch
BranchTrueFalseTotal
my $self = shift() or croak("Usage: clear E2USERGROUP") 3 0 3
48  
49 3 ▶ warn "E2::Room::clear\n" if $DEBUG > 1;
Branch: 1 branch
BranchTrueFalseTotal
if $E2::Room::DEBUG > 1 0 3 3
50  
51 3 $self->{description} = undef;
52 3 $self->{can_enter} = undef;
53  
54 # Now clear parent
55  
56 3 return $self->SUPER::clear;
57 }
58  
59 1 ▶sub twig_handlers {
Subroutine twig_handlers: called CC=2 SCAR=10.9
Pod undocumented
60 1 ▶ my $self = shift or croak "Usage: twig_handlers E2USERGROUP";
Branch: 1 branch
BranchTrueFalseTotal
my $self = shift() or croak("Usage: twig_handlers E2USERGROUP") 1 0 1
61  
62 return (
63 0 ▶ 'description' => sub {
Subroutine __ANON__: not called CC=1 SCAR=6.9
64 0 (my $a, my $b) = @_;
65 0 $self->{description} = $b->text;
66 },
67 0 ▶ 'canenter' => sub {
Subroutine __ANON__: not called CC=1 SCAR=6.9
68 0 (my $a, my $b) = @_;
69 0 $self->{can_enter} = $b->text;
70 }
71 1 );
72 }
73  
74 1 ▶sub type_as_string {
Subroutine type_as_string: called CC=1 SCAR=0.0
Pod undocumented
75 1 return 'room';
76 }
77  
78 0 ▶sub description {
Subroutine description: not called CC=2 SCAR=17.9
Pod documented
79 0 ▶ my $self = shift or croak "Usage: description E2ROOM";
Branch: 1 branch
BranchTrueFalseTotal
my $self = shift() or croak("Usage: description E2ROOM") 0 0 0
80 0 return $self->{description};
81 }
82  
83 0 ▶sub can_enter {
Subroutine can_enter: not called CC=2 SCAR=17.9
Pod documented
84 0 ▶ my $self = shift or croak "Usage: can_enter E2ROOM";
Branch: 1 branch
BranchTrueFalseTotal
my $self = shift() or croak("Usage: can_enter E2ROOM") 0 0 0
85 0 return $self->{can_enter};
86 }
87  
88 2 1;
89 __END__
« Usergroup.pm ↑ Summary Superdoc.pm »