Visio/Master.pm

filter: Statementstmt 53.7% 29 / 54 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 64.2% 9 / 14 Podpod 0.0% 0 / 5 totaltotal 50.6% 38 / 75 CC 2 SCAR 6.6
CC
2
Cov
52%
new
6.0
set_id
2.0
get_id
2.0
CRAP 1.9
« Visio/PageProps.pm ↑ Summary Visio/Hyperlink.pm »
1 package Visio::Master;
2  
3 #PLEASE SEE MSPATENTLICENSE
4 # "This product may incorporate intellectual property owned by
5 # Microsoft Corporation. The terms and conditions upon which Microsoft
6 # is licensing such intellectual property may be found at
7 # http://msdn.microsoft.com/library/en-us/odcXMLRef/html/odcXMLRefLegalNotice.asp"
8  
9 # Copyright 2005 Aamer Akhter. All rights reserved.
10  
11 # Redistribution and use in source and binary forms, with or without
12 # modification, are permitted provided that the following conditions are
13 # met:
14  
15 # 1. Redistributions of source code must retain the above copyright
16 # notice, this list of conditions and the following disclaimer.
17  
18 # 2. Redistributions in binary form must reproduce the above copyright
19 # notice, this list of conditions and the following disclaimer in the
20 # documentation and/or other materials provided with the distribution.
21  
22 # THIS SOFTWARE IS PROVIDED BY THE LICENSOR(S) ``AS IS'' AND ANY EXPRESS
23 # OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
24 # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
25 # DISCLAIMED. IN NO EVENT SHALL THE LICENSOR(S) OR OTHER CONTRIBUTORS BE
26 # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
27 # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
28 # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
29 # BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
30 # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
31 # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
32 # IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33  
34 # The views and conclusions contained in the software and documentation
35 # are those of the authors and should not be interpreted as representing
36 # official policies, either expressed or implied, of the Licensor(s).
37  
38 # The software may be subject to additional license restrictions
39 # provided by the Licensor(s).
40  
41  
42  
43 1 ▶use 5.008;
Subroutine BEGIN: called CC=1 SCAR=0.0
44 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
45 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
46 1 ▶use Log::Log4perl qw(get_logger);
Subroutine BEGIN: called CC=1 SCAR=0.0
47 1 ▶use XML::LibXML;
Subroutine BEGIN: called CC=1 SCAR=0.0
48 1 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
49 1 ▶use Data::Dumper;
Subroutine BEGIN: called CC=1 SCAR=0.0
50 1 ▶use vars qw($VERSION);
Subroutine BEGIN: called CC=1 SCAR=0.0
51  
52 1 ▶use Visio::PageSheet;
Subroutine BEGIN: called CC=1 SCAR=0.0
53  
54 1 $VERSION = sprintf "%d.%03d", q$Revision: 1.5 $ =~ /: (\d+)\.(\d+)/;
55  
56 1 my $log = get_logger('visio.Master');
57  
58 # Preloaded methods go here.
59  
60 0 ▶sub new {
Subroutine new: not called CC=2 SCAR=17.9
Pod undocumented
61 0 my $class = shift;
62 0 my $MastersN = shift;
63 0 my $id = shift;
64 0 my $opts = shift;
65 0 my $fromDom = $$opts{fromDom};
66 0 my $self = {};
67 0 $self->{MastersN} = $MastersN;
68 0 $self->{xmldoc} = $MastersN->ownerDocument;
69 0 $self->{xmlroot} = $self->{xmldoc}->documentElement;
70 0 $self->{masterid} = $id;
71 0 bless($self,$class);
72 0 ▶ if (defined $fromDom) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $fromDom) 0 0 0
73 0 $self->{masterNode} = $self->{MastersN}->appendChild($fromDom);
74 }
75 0 $self->set_id;
76 0 $log->debug("visio Master object ($id) created");
77 0 return $self;
78 }
79  
80 0 ▶sub set_id {
Subroutine set_id: not called CC=1 SCAR=6.9
Pod undocumented
81 0 my $self = shift;
82 0 $self->{masterNode}->setAttribute('ID',$self->{masterid});
83 }
84  
85 0 ▶sub get_id {
Subroutine get_id: not called CC=1 SCAR=6.9
Pod undocumented
86 0 my $self = shift;
87 0 return $self->{masterid};
88 }
89  
90 0 ▶sub set_name {
Subroutine set_name: not called CC=1 SCAR=6.9
Pod undocumented
91 0 my $self = shift;
92 0 my $name = shift;
93 0 $self->{masterNode}->setAttribute('Name',$name);
94 }
95  
96 0 ▶sub get_node {
Subroutine get_node: not called CC=1 SCAR=6.9
Pod undocumented
97 0 my $self = shift;
98 0 return $self->{masterNode};
99 }
100  
101 1 1;
102 __END__
« Visio/PageProps.pm ↑ Summary Visio/Hyperlink.pm »