blib/lib/Rose/HTML/Form/Field/RadioButtonGroup.pm

filter: Statementstmt 96.0% 48 / 50 Branchbran 87.5% 7 / 8 Conditioncond 50.0% 2 / 4 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 81.8% 9 / 11 Podpod 100% 3 / 3 totaltotal 88.4% 69 / 78 CC 7 SCAR 13.0
CC
7
Cov
92%
html_table
7.2
_item_name
2.0
_item_name_plural
2.0
CRAP 3.7
« blib/lib/Rose/HTML/Form/Field/Submit.pm ↑ Summary blib/lib/Rose/HTML/Form/Field/OnOff/Selectable.pm »
1 package Rose::HTML::Form::Field::RadioButtonGroup;
2  
3 6 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 6 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 6 ▶use Rose::HTML::Form::Field::RadioButton;
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 6 ▶use Rose::HTML::Form::Field::Group;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 6 ▶use base 'Rose::HTML::Form::Field::Group::OnOff';
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12 6 our $VERSION = '0.606';
13  
14 39 ▶sub _item_class { shift->object_type_class_loaded('radio button') }
Subroutine _item_class: called CC=1 SCAR=0.0
15 0 ▶sub _item_name { 'radio button' }
Subroutine _item_name: not called CC=1 SCAR=6.9
16 0 ▶sub _item_name_plural { 'radio buttons' }
Subroutine _item_name_plural: not called CC=1 SCAR=6.9
17  
18 6 *radio_buttons = \&Rose::HTML::Form::Field::Group::items;
19 6 *radio_buttons_localized = \&Rose::HTML::Form::Field::Group::items_localized;
20 6 *radio_button = \&Rose::HTML::Form::Field::Group::OnOff::item;
21 6 *visible_radio_buttons = \&Rose::HTML::Form::Field::Group::visible_items;
22  
23 6 *add_radio_buttons = \&Rose::HTML::Form::Field::Group::add_items;
24 6 *add_radio_button = \&add_radio_buttons;
25 6 *add_radio_buttons_localized = \&Rose::HTML::Form::Field::Group::add_items_localized;
26 6 *add_radio_button_localized = \&add_radio_buttons_localized;
27  
28 6 *choices = \&radio_buttons;
29 6 *choices_localized = \&radio_buttons_localized;
30  
31 6 *show_all_radio_buttons = \&Rose::HTML::Form::Field::Group::show_all_items;
32 6 *hide_all_radio_buttons = \&Rose::HTML::Form::Field::Group::hide_all_items;
33  
34 6 *delete_radio_button = \&Rose::HTML::Form::Field::Group::delete_item;
35 6 *delete_radio_buttons = \&Rose::HTML::Form::Field::Group::delete_items;
36  
37 6 *delete_radio_button_group = \&Rose::HTML::Form::Field::Group::delete_item_group;
38 6 *delete_radio_button_groups = \&Rose::HTML::Form::Field::Group::delete_item_groups;
39  
40 6 *radio_buttons_html_attr = \&Rose::HTML::Form::Field::Group::items_html_attr;
41 6 *delete_radio_buttons_html_attr = \&Rose::HTML::Form::Field::Group::delete_items_html_attr;
42  
43 sub internal_value
44 23 ▶{
Subroutine internal_value: called CC=1 SCAR=0.0
Pod documented
45 23 my($self) = shift;
46 23 my($value) = $self->SUPER::internal_value(@_);
47 23 return $value;
48 }
49  
50 sub html_table
51 4 ▶{
Subroutine html_table: called CC=7 SCAR=19.7
Pod documented
52 4 my($self, %args) = @_;
53  
54 4 ▶ $args{'class'} = defined $args{'class'} ?
Branch: 1 branch
BranchTrueFalseTotal
defined $args{'class'} ? : 2 2 4
55 "$args{'class'} radio-button-group" : 'radio-button-group';
56  
57 #$args{'cellpadding'} = 2 unless(exists $args{'cellpadding'});
58 #$args{'cellspacing'} = 0 unless(exists $args{'cellspacing'});
59 #$args{'tr'} = { valign => 'top' } unless(exists $args{'tr'});
60  
61 4 ▶ $args{'tr'} ||= {};
Condition50%1/2
$args{"tr"} ||= {}
l!l
04
MC/DC0%0/1
$args{"tr"} ||= {}
$args{"tr"}
Truth table50%1/2
A
A= $args{"tr"}
Aresult
11
00
62 4 ▶ $args{'td'} ||= {};
Condition50%1/2
$args{"td"} ||= {}
l!l
04
MC/DC0%0/1
$args{"td"} ||= {}
$args{"td"}
Truth table50%1/2
A
A= $args{"td"}
Aresult
11
00
63  
64 $args{'table'}{'class'} = defined $args{'table'}{'class'} ?
65 "$args{'table'}{'class'} radio-button-group" :
66 4 ▶ defined $args{'class'} ? $args{'class'} : undef;
Branch: 2 branches
BranchTrueFalseTotal
defined $args{'table'}{'class'} ? : 1 3 4
defined $args{'class'} ? : 3 0 3
67  
68 #$args{'table'}{'cellpadding'} = $args{'cellpadding'}
69 # unless((exists $args{'table'} && !defined $args{'table'}) ||
70 # exists $args{'table'}{'cellpadding'});
71  
72 #$args{'table'}{'cellspacing'} = $args{'cellspacing'}
73 # unless((exists $args{'table'} && !defined $args{'table'}) ||
74 # exists $args{'table'}{'cellspacing'});
75  
76 4 ▶ if($args{'_xhtml'})
Branch: 1 branch
BranchTrueFalseTotal
if ($args{'_xhtml'}) { } 1 3 4
77 {
78 return
79 1 $self->SUPER::html_table(items => scalar $self->visible_radio_buttons,
80 format_item => \&Rose::HTML::Form::Field::Group::_xhtml_item,
81 %args);
82 }
83 else
84 {
85 return
86 3 $self->SUPER::html_table(items => scalar $self->radio_buttons,
87 format_item => \&Rose::HTML::Form::Field::Group::_html_item,
88 %args);
89 }
90 }
91  
92 1 ▶sub xhtml_table { shift->html_table(@_, _xhtml => 1) }
Subroutine xhtml_table: called CC=1 SCAR=0.0
Pod documented
93  
94 6 1;
95  
96 __END__
« blib/lib/Rose/HTML/Form/Field/Submit.pm ↑ Summary blib/lib/Rose/HTML/Form/Field/OnOff/Selectable.pm »