OMatic/Versions.pm

filter: Statementstmt 52.6% 10 / 19 Branchbran n/a Conditioncond 0.0% 0 / 5 MC/DCmcdc 0.0% 0 / 3 Subroutinesub 60.0% 3 / 5 Podpod 0.0% 0 / 2 totaltotal 38.2% 13 / 34 CC 3 SCAR 13.5
CC
3
Cov
42%
getVersion
6.0
setVersion
6.0
BEGIN
1.0
CRAP 3.9
« OMatic/recent.pm ↑ Summary OMatic/mirrorServer.pm »
1 ##############################################################################
2 # The Faq-O-Matic is Copyright 1997 by Jon Howell, all rights reserved. #
3 # #
4 # This program is free software; you can redistribute it and/or #
5 # modify it under the terms of the GNU General Public License #
6 # as published by the Free Software Foundation; either version 2 #
7 # of the License, or (at your option) any later version. #
8 # #
9 # This program is distributed in the hope that it will be useful, #
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of #
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
12 # GNU General Public License for more details. #
13 # #
14 # You should have received a copy of the GNU General Public License #
15 # along with this program; if not, write to the Free Software #
16 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.#
17 # #
18 # Jon Howell can be contacted at: #
19 # 6211 Sudikoff Lab, Dartmouth College #
20 # Hanover, NH 03755-3510 #
21 # jonh@cs.dartmouth.edu #
22 # #
23 # An electronic copy of the GPL is available at: #
24 # http://www.gnu.org/copyleft/gpl.html #
25 # #
26 ##############################################################################
27  
28 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
29  
30 ###
31 ### The Versions module is used by the installer and maintenance modules
32 ### to keep track of upgrade status.
33 ###
34  
35 package FAQ::OMatic::Versions;
36  
37 1 ▶use FAQ::OMatic;
Subroutine BEGIN: called CC=1 SCAR=0.0
38 1 ▶use FAQ::OMatic::Item;
Subroutine BEGIN: called CC=1 SCAR=0.0
39  
40 0 ▶sub getVersion {
Subroutine getVersion: not called CC=2 SCAR=17.9
Pod undocumented
41 0 my $property = shift;
42  
43 0 my $versionItem = new FAQ::OMatic::Item('versionFile',
44 $FAQ::OMatic::Config::metaDir);
45 0 ▶ return $versionItem->{$property} || '';
Condition0%0/2
$versionItem->{$property} || ''
l!l
00
MC/DC0%0/1
$versionItem->{$property} || ''
$versionItem->{$property}
Truth table0%0/2
A
A= $versionItem->{$property}
Aresult
11
00
46 }
47  
48 0 ▶sub setVersion {
Subroutine setVersion: not called CC=2 SCAR=17.9
Pod undocumented
49 0 my $property = shift;
50 0 ▶ my $version = shift || $FAQ::OMatic::VERSION;
Condition0%0/3
shift() || $FAQ::OMatic::VERSION
l!l&&r!l&&!r
000
MC/DC0%0/2
shift() || $FAQ::OMatic::VERSION
shift() $FAQ::OMatic::VERSION
Truth table0%0/3
A || B
A= shift()B= $FAQ::OMatic::VERSION
ABresult
1X1
011
000
51  
52 0 my $versionItem = new FAQ::OMatic::Item('versionFile',
53 $FAQ::OMatic::Config::metaDir);
54 0 $versionItem->setProperty('Title', "Versions Data File");
55 0 $versionItem->setProperty($property, $version);
56 0 $versionItem->saveToFile('versionFile',
57 $FAQ::OMatic::Config::metaDir);
58 }
59  
60 1 1;
« OMatic/recent.pm ↑ Summary OMatic/mirrorServer.pm »