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

filter: Statementstmt 95.3% 41 / 43 Branchbran 87.5% 7 / 8 Conditioncond 50.0% 2 / 4 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 80.0% 8 / 10 Podpod 100% 2 / 2 totaltotal 86.9% 60 / 69 CC 7 SCAR 13.4
CC
7
Cov
91%
html_table
7.2
_item_name
2.0
_item_name_plural
2.0
CRAP 3.8
« blib/lib/Rose/HTML/Form/Field/Date.pm ↑ Summary blib/lib/Rose/HTML/Form/Field/DateTime.pm »
1 package Rose::HTML::Form::Field::CheckboxGroup;
2  
3 5 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 5 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 5 ▶use base 'Rose::HTML::Form::Field::Group::OnOff';
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 5 ▶use Rose::HTML::Form::Field::Group;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 5 ▶use Rose::HTML::Form::Field::Checkbox;
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12 5 our $VERSION = '0.606';
13  
14 14 ▶sub _item_class { shift->object_type_class_loaded('checkbox') }
Subroutine _item_class: called CC=1 SCAR=0.0
15 0 ▶sub _item_name { 'checkbox' }
Subroutine _item_name: not called CC=1 SCAR=6.9
16 0 ▶sub _item_name_plural { 'checkboxes' }
Subroutine _item_name_plural: not called CC=1 SCAR=6.9
17  
18 5 *checkboxes = \&Rose::HTML::Form::Field::Group::items;
19 5 *visible_checkboxes = \&Rose::HTML::Form::Field::Group::visible_items;
20  
21 5 *checkbox = \&Rose::HTML::Form::Field::Group::OnOff::item;
22 5 *add_checkboxes = \&Rose::HTML::Form::Field::Group::add_items;
23 5 *add_checkbox = \&add_checkboxes;
24  
25 5 *choices = \&checkboxes;
26  
27 5 *show_all_checkboxes = \&Rose::HTML::Form::Field::Group::show_all_items;
28 5 *hide_all_checkboxes = \&Rose::HTML::Form::Field::Group::hide_all_items;
29  
30 5 *delete_checkbox = \&Rose::HTML::Form::Field::Group::delete_item;
31 5 *delete_checkboxes = \&Rose::HTML::Form::Field::Group::delete_items;
32  
33 5 *delete_checkbox_group = \&Rose::HTML::Form::Field::Group::delete_item_group;
34 5 *delete_checkboxes_groups = \&Rose::HTML::Form::Field::Group::delete_item_groups;
35  
36 5 *checkboxes_html_attr = \&Rose::HTML::Form::Field::Group::items_html_attr;
37 5 *delete_checkboxes_html_attr = \&Rose::HTML::Form::Field::Group::delete_items_html_attr;
38  
39 sub html_table
40 4 ▶{
Subroutine html_table: called CC=7 SCAR=19.7
Pod documented
41 4 my($self, %args) = @_;
42  
43 4 ▶ $args{'class'} = defined $args{'class'} ?
Branch: 1 branch
BranchTrueFalseTotal
defined $args{'class'} ? : 1 3 4
44 "$args{'class'} checkbox-group" : 'checkbox-group';
45  
46 #$args{'cellpadding'} = 2 unless(exists $args{'cellpadding'});
47 #$args{'cellspacing'} = 0 unless(exists $args{'cellspacing'});
48 #$args{'tr'} = { valign => 'top' } unless(exists $args{'tr'});
49  
50 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
51 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
52  
53 $args{'table'}{'class'} = defined $args{'table'}{'class'} ?
54 "$args{'table'}{'class'} checkbox-group" :
55 4 ▶ defined $args{'class'} ? $args{'class'} : undef;
Branch: 2 branches
BranchTrueFalseTotal
defined $args{'table'}{'class'} ? : 1 3 4
defined $args{'class'} ? : 3 0 3
56  
57 #$args{'table'}{'cellpadding'} = $args{'cellpadding'}
58 # unless((exists $args{'table'} && !defined $args{'table'}) ||
59 # exists $args{'table'}{'cellpadding'});
60  
61 #$args{'table'}{'cellspacing'} = $args{'cellspacing'}
62 # unless((exists $args{'table'} && !defined $args{'table'}) ||
63 # exists $args{'table'}{'cellspacing'});
64  
65 4 ▶ if($args{'_xhtml'})
Branch: 1 branch
BranchTrueFalseTotal
if ($args{'_xhtml'}) { } 1 3 4
66 {
67 return
68 1 $self->SUPER::html_table(items => scalar $self->visible_checkboxes,
69 format_item => \&Rose::HTML::Form::Field::Group::_xhtml_item,
70 %args);
71 }
72 else
73 {
74 return
75 3 $self->SUPER::html_table(items => scalar $self->visible_checkboxes,
76 format_item => \&Rose::HTML::Form::Field::Group::_html_item,
77 %args);
78 }
79 }
80  
81 1 ▶sub xhtml_table { shift->html_table(@_, _xhtml => 1) }
Subroutine xhtml_table: called CC=1 SCAR=0.0
Pod documented
82  
83 5 1;
84  
85 __END__
« blib/lib/Rose/HTML/Form/Field/Date.pm ↑ Summary blib/lib/Rose/HTML/Form/Field/DateTime.pm »