JavaScript/AutoSelect.pm

filter: Statementstmt 71.4% 10 / 14 Branchbran n/a Conditioncond 0.0% 0 / 2 MC/DCmcdc 0.0% 0 / 1 Subroutinesub 75.0% 3 / 4 Podpod 100% 1 / 1 totaltotal 63.6% 14 / 22 CC 2 SCAR 11.0
CC
2
Cov
62%
value_to_string
6.0
BEGIN
1.0
BEGIN
1.0
CRAP 3.0
« JavaScript/Test.pm ↑ Summary JavaScript/Serializer/List.pm »
1 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
2 1 ▶use warnings FATAL => 'all';
Subroutine BEGIN: called CC=1 SCAR=0.0
3  
4 package HTML::Tested::JavaScript::AutoSelect;
5 1 ▶use base 'HTML::Tested::Value::DropDown';
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 0 ▶sub value_to_string {
Subroutine value_to_string: not called CC=2 SCAR=17.9
Pod documented
8 0 my ($self, $name, $val) = @_;
9 0 my $res = $self->SUPER::value_to_string($name, $val);
10 0 ▶ my $href = $self->options->{href} || "?$name=";
Condition0%0/2
$self->options->{'href'} || "?$name="
l!l
00
MC/DC0%0/1
$self->options->{'href'} || "?$name="
$self->options->{'href'}
Truth table0%0/2
A
A= $self->options->{'href'}
Aresult
11
00
11 return <<ENDS
12 <form>$res</form>
13 <script>
14 document.getElementById("$name").onchange = function() {
15 document.location.href = "$href" + this.options[
16 this.selectedIndex ].value;
17 };
18 </script>
19 ENDS
20 0 }
21  
22 1 1;
« JavaScript/Test.pm ↑ Summary JavaScript/Serializer/List.pm »