log/debug.pm

filter: Statementstmt 22.2% 8 / 36 Branchbran 0.0% 0 / 8 Conditioncond 0.0% 0 / 6 MC/DCmcdc 0.0% 0 / 4 Subroutinesub 50.0% 2 / 4 Podpod 100% 2 / 2 totaltotal 20.0% 12 / 60 CC 8 SCAR 32.7
CC
8
Cov
16%
getHtml
42.0
new
12.0
BEGIN
1.0
CRAP 26.4
↑ Summary log/info.pm »
1 package HTML::GUI::log::debug;
2  
3 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 =head1 NAME
7  
8 HTML::GUI::log::debug - Create and control a debug input for webapp
9  
10 =head1 VERSION
11  
12 Version 0.01
13  
14 =cut
15  
16 1 our $VERSION = '0.01';
17  
18  
19 =head1 debug
20  
21 The debug module to log all errors/debug/information messages
22  
23 =cut
24  
25  
26 =head1 PUBLIC METHODS
27  
28 =pod
29  
30 =head3 new
31  
32 =cut
33  
34 sub new
35 0 ▶{
Subroutine new: not called CC=3 SCAR=24.8
Pod documented
36 0 my($class,
37 $params, # widget :
38 ) = @_;
39 0 $params->{type} = "debug";
40 0 my $this = $class->SUPER::new($params);
41 0 ▶ if (!$this){
Branch: 1 branch
BranchTrueFalseTotal
unless ($this) 0 0 0
42 0 return undef;
43 }
44 0 $this->{options} = [];
45  
46 0 bless($this, $class);
47 0 ▶ if (exists $params->{options}){
Branch: 1 branch
BranchTrueFalseTotal
if (exists $params->{"options"}) 0 0 0
48 0 $this->setOptions($params->{options});
49 }
50 0 return $this;
51 }
52  
53 =pod
54  
55 =pod
56  
57 =head3 getHtml
58  
59 Description :
60 Return the html of the debug for the public debugs who should be presented to the user.
61  
62 =cut
63  
64 sub getHtml
65 0 ▶{
Subroutine getHtml: not called CC=6 SCAR=37.4
Pod documented
66 0 my($self) = @_;
67 0 my %tagProp=();
68 0 my %styleProp=();
69
70  
71 0 ▶ if (exists $self->{display} && 0==$self->{display}){
Branch: 1 branch
BranchTrueFalseTotal
if (exists $self->{"display"} and 0 == $self->{"display"}) 0 0 0
Condition0%0/3
exists $self->{"display"} and 0 == $self->{"display"}
!ll&&!rl&&r
000
MC/DC0%0/2
exists $self->{"display"} and 0 == $self->{"display"}
exists $self->{"display"} 0 == $self->{"display"}
Truth table0%0/3
A and B
A= exists $self->{"display"}B= 0 == $self->{"display"}
ABresult
0X0
100
111
72 0 $styleProp{display} = 'none';
73 }
74  
75 0 $tagProp{style} = $self->getStyleContent(\%styleProp);
76 0 $tagProp{name} = $tagProp{id} = $self->{id};
77 0 $tagProp{size} = '1';
78  
79 0 my $optionHtml = '';
80 0 my $currentValue = $self->getValue();
81 0 foreach my $option (@{$self->{options}}){
82 0 my $optionProp = {};
83  
84 0 ▶ if (defined $currentValue
Branch: 1 branch
BranchTrueFalseTotal
if (defined $currentValue and $currentValue eq $option->{"value"}) 0 0 0
Condition0%0/3
defined $currentValue and $currentValue eq $option->{"value"}
!ll&&!rl&&r
000
MC/DC0%0/2
defined $currentValue and $currentValue eq $option->{"value"}
defined $currentValue $currentValue eq $option->{"value"}
Truth table0%0/3
A and B
A= defined $currentValueB= $currentValue eq $option->{"value"}
ABresult
0X0
100
111
85 && ($currentValue eq $option->{value})){
86 0 $optionProp->{debuged} = 'debuged';
87 }
88 0 $optionProp->{value} = $option->{value};
89  
90 $optionHtml .= $self->getHtmlTag("option",
91 $optionProp,
92 0 $self->escapeHtml($option->{label}));
93
94 }
95
96 0 return $self->getHtmlTag("p",{class=>("float")},
97 $self->getLabelHtml()
98 .$self->getHtmlTag("debug",
99 \%tagProp,$optionHtml)
100 );
101 }
102  
103  
104 =head1 AUTHOR
105  
106 Jean-Christian Hassler, C<< <jhassler at free.fr> >>
107  
108 =head1 BUGS
109  
110 Please report any bugs or feature requests to
111 C<bug-gui-libhtml-debug at rt.cpan.org>, or through the web interface at
112 L<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=HTML-GUI-widget>.
113 I will be notified, and then you'll automatically be notified of progress on
114 your bug as I make changes.
115  
116 =head1 SUPPORT
117  
118 You can find documentation for this module with the perldoc command.
119  
120 perldoc HTML::GUI::widget
121  
122 You can also look for information at:
123  
124 =over 4
125  
126 =item * AnnoCPAN: Annotated CPAN documentation
127  
128 L<http://annocpan.org/dist/HTML-GUI-widget>
129  
130 =item * CPAN Ratings
131  
132 L<http://cpanratings.perl.org/d/HTML-GUI-widget>
133  
134 =item * RT: CPAN's request tracker
135  
136 L<http://rt.cpan.org/NoAuth/Bugs.html?Dist=HTML-GUI-widget>
137  
138 =item * Search CPAN
139  
140 L<http://search.cpan.org/dist/HTML-GUI-widget>
141  
142 =back
143  
144 =head1 ACKNOWLEDGEMENTS
145  
146 =head1 COPYRIGHT & LICENSE
147  
148 Copyright 2007 Jean-Christian Hassler, all rights reserved.
149  
150 This program is free software; you can redistribute it and/or modify it
151 under the same terms as Perl itself.
152  
153 =cut
154  
155 1 1; # End of HTML::GUI::debug::debug
↑ Summary log/info.pm »