Wizard/Elem/CheckBox/Shell.pm

filter: Statementstmt 50.0% 9 / 18 Branchbran 0.0% 0 / 6 Conditioncond 0.0% 0 / 5 MC/DCmcdc 0.0% 0 / 3 Subroutinesub 66.6% 2 / 3 Podpod 0.0% 0 / 1 totaltotal 30.5% 11 / 36 CC 6 SCAR 34.6
CC
6
Cov
31%
Display
42.0
BEGIN
1.0
BEGIN
1.0
CRAP 31.8
« Wizard/Elem/Link/HTML.pm ↑ Summary Wizard/Elem/Data/Shell.pm »
1 # -*- perl -*-
2 #
3 # Wizard - A Perl package for implementing system administration
4 # applications in the style of Windows wizards.
5 #
6 #
7 # This module is
8 #
9 # Copyright (C) 1999 Jochen Wiedmann
10 # Am Eisteich 9
11 # 72555 Metzingen
12 # Germany
13 #
14 # Email: joe@ispsoft.de
15 # Phone: +49 7123 14887
16 #
17 # and Amarendran R. Subramanian
18 # Grundstr. 32
19 # 72810 Gomaringen
20 # Germany
21 #
22 # Email: amar@ispsoft.de
23 # Phone: +49 7072 920696
24 #
25 # All Rights Reserved.
26 #
27 # You may distribute under the terms of either the GNU General Public
28 # License or the Artistic License, as specified in the Perl README file.
29 #
30 # $Id$
31 #
32  
33 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
34  
35 1 ▶use Wizard::Elem::Shell ();
Subroutine BEGIN: called CC=1 SCAR=0.0
36  
37  
38 package Wizard::Elem::CheckBox::Shell;
39  
40 1 @Wizard::Elem::CheckBox::Shell::ISA = qw(Wizard::Elem::Shell);
41 1 $Wizard::Elem::CheckBox::Shell::VERSION = '0.01';
42  
43  
44 0 ▶sub Display {
Subroutine Display: not called CC=6 SCAR=37.4
Pod undocumented
45 0 my($self, $wiz, $form, $state) = @_;
46 0 ▶ $self->{'default'} ||= 'no';
Condition0%0/2
$self->{"default"} ||= "no"
l!l
00
MC/DC0%0/1
$self->{"default"} ||= "no"
$self->{"default"}
Truth table0%0/2
A
A= $self->{"default"}
Aresult
11
00
47 0 ▶ my $val = defined($self->{'value'}) ? $self->{'value'} : $self->{'default'};
Branch: 1 branch
BranchTrueFalseTotal
defined $self->{'value'} ? : 0 0 0
48 0 $form->print("$self->{'descr'} (yes/no, default is no) [$val]: ");
49 0 my $reply = $form->readline();
50 0 chomp $reply;
51 0 ▶ $reply = $val unless (($reply eq 'yes') ||
Branch: 1 branch
BranchTrueFalseTotal
unless $reply eq "yes" or $reply eq "no" 0 0 0
Condition0%0/3
$reply eq "yes" or $reply eq "no"
l!l&&r!l&&!r
000
MC/DC0%0/2
$reply eq "yes" or $reply eq "no"
$reply eq "yes" $reply eq "no"
Truth table0%0/3
A or B
A= $reply eq "yes"B= $reply eq "no"
ABresult
1X1
011
000
52 ($reply eq 'no'));
53 0 ▶ $reply = ($reply eq 'yes') ? 'yes' : '';
Branch: 1 branch
BranchTrueFalseTotal
$reply eq 'yes' ? : 0 0 0
54 0 return $wiz->param($self->{'name'}, $reply);
55 }
56  
57  
58 1 1;
« Wizard/Elem/Link/HTML.pm ↑ Summary Wizard/Elem/Data/Shell.pm »