| 1 | package HTML::Widgets::NavMenu::Iterator::JQTreeView; | ||||||||||||||||||||||||||||
| 2 | 3 | $HTML::Widgets::NavMenu::Iterator::JQTreeView::VERSION = '1.1000'; | |||||||||||||||||||||||||||
| 3 | 3 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 4 | 3 | ▶ | use warnings; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 5 | |||||||||||||||||||||||||||||
| 6 | 3 | ▶ | use HTML::Widgets::NavMenu::EscapeHtml qw/ escape_html /; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||
| 8 | 3 | ▶ | use parent qw(HTML::Widgets::NavMenu::Iterator::NavMenu); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 9 | |||||||||||||||||||||||||||||
| 10 | sub _init | ||||||||||||||||||||||||||||
| 11 | 21 | ▶ | { | ||||||||||||||||||||||||||
|
Subroutine
_init: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 12 | 21 | my $self = shift; | |||||||||||||||||||||||||||
| 13 | 21 | my $args = shift; | |||||||||||||||||||||||||||
| 14 | |||||||||||||||||||||||||||||
| 15 | 21 | $self->SUPER::_init($args); | |||||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||||||
| 17 | # Make a fresh copy just to be on the safe side. | ||||||||||||||||||||||||||||
| 18 | 21 | $self->_ul_classes( [ @{ $args->{'ul_classes'} } ] ); | |||||||||||||||||||||||||||
| 19 | |||||||||||||||||||||||||||||
| 20 | 21 | return 0; | |||||||||||||||||||||||||||
| 21 | } | ||||||||||||||||||||||||||||
| 22 | |||||||||||||||||||||||||||||
| 23 | |||||||||||||||||||||||||||||
| 24 | sub _calc_open_li_tag | ||||||||||||||||||||||||||||
| 25 | 17 | ▶ | { | ||||||||||||||||||||||||||
|
Subroutine
_calc_open_li_tag: called CC=2 SCAR=7.0
| |||||||||||||||||||||||||||||
| 26 | 17 | my $self = shift; | |||||||||||||||||||||||||||
| 27 | |||||||||||||||||||||||||||||
| 28 | 17 | my $id_attr = $self->_calc_li_id_attr(); | |||||||||||||||||||||||||||
| 29 | |||||||||||||||||||||||||||||
| 30 | return ( | ||||||||||||||||||||||||||||
| 31 | 17 | ▶ | $self->_is_expanded_for_treeview() | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 32 | ? (qq{<li class="open"$id_attr>}) | ||||||||||||||||||||||||||||
| 33 | : ("<li$id_attr>") | ||||||||||||||||||||||||||||
| 34 | ); | ||||||||||||||||||||||||||||
| 35 | |||||||||||||||||||||||||||||
| 36 | 0 | return; | |||||||||||||||||||||||||||
| 37 | } | ||||||||||||||||||||||||||||
| 38 | |||||||||||||||||||||||||||||
| 39 | |||||||||||||||||||||||||||||
| 40 | sub _start_handle_non_role | ||||||||||||||||||||||||||||
| 41 | 17 | ▶ | { | ||||||||||||||||||||||||||
|
Subroutine
_start_handle_non_role: called CC=3 SCAR=11.0
| |||||||||||||||||||||||||||||
| 42 | 17 | my $self = shift; | |||||||||||||||||||||||||||
| 43 | 17 | my $top_item = $self->top; | |||||||||||||||||||||||||||
| 44 | 17 | my @tags_to_add = ( $self->_calc_open_li_tag(), $self->get_link_tag() ); | |||||||||||||||||||||||||||
| 45 | 17 | ▶ | if ( $top_item->_num_subs_to_go() && $self->_is_expanded() ) | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
$top_item->_num_subs_to_go and $self->_is_expanded
MC/DC50%1/2
$top_item->_num_subs_to_go and $self->_is_expanded
$top_item->_num_subs_to_go
$self->_is_expanded
Truth table66%2/3
A and B
A= $top_item->_num_subs_to_goB= $self->_is_expanded
| |||||||||||||||||||||||||||||
| 46 | { | ||||||||||||||||||||||||||||
| 47 | 4 | push @tags_to_add, ( $self->get_open_sub_menu_tags() ); | |||||||||||||||||||||||||||
| 48 | } | ||||||||||||||||||||||||||||
| 49 | 17 | $self->_add_tags(@tags_to_add); | |||||||||||||||||||||||||||
| 50 | |||||||||||||||||||||||||||||
| 51 | 17 | return; | |||||||||||||||||||||||||||
| 52 | } | ||||||||||||||||||||||||||||
| 53 | |||||||||||||||||||||||||||||
| 54 | sub _start_handle_role | ||||||||||||||||||||||||||||
| 55 | 0 | ▶ | { | ||||||||||||||||||||||||||
|
Subroutine
_start_handle_role: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||
| 56 | 0 | my $self = shift; | |||||||||||||||||||||||||||
| 57 | |||||||||||||||||||||||||||||
| 58 | 0 | return $self->_start_handle_non_role(); | |||||||||||||||||||||||||||
| 59 | } | ||||||||||||||||||||||||||||
| 60 | |||||||||||||||||||||||||||||
| 61 | sub _is_expanded | ||||||||||||||||||||||||||||
| 62 | 49 | ▶ | { | ||||||||||||||||||||||||||
|
Subroutine
_is_expanded: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 63 | 49 | return 1; | |||||||||||||||||||||||||||
| 64 | } | ||||||||||||||||||||||||||||
| 65 | |||||||||||||||||||||||||||||
| 66 | sub _is_expanded_for_treeview | ||||||||||||||||||||||||||||
| 67 | 17 | ▶ | { | ||||||||||||||||||||||||||
|
Subroutine
_is_expanded_for_treeview: called CC=2 SCAR=7.0
| |||||||||||||||||||||||||||||
| 68 | 17 | my $self = shift; | |||||||||||||||||||||||||||
| 69 | |||||||||||||||||||||||||||||
| 70 | 17 | my $node = $self->top->_node(); | |||||||||||||||||||||||||||
| 71 | |||||||||||||||||||||||||||||
| 72 | 17 | ▶ | return ( $node->expanded() || $self->top->_accum_state->{'show_always'} ); | ||||||||||||||||||||||||||
|
Condition66%2/3
$node->expanded || $self->top->_accum_state->{'show_always'}
MC/DC50%1/2
$node->expanded || $self->top->_accum_state->{'show_always'}
$node->expanded
$self->top->_accum_state->{'show_always'}
Truth table66%2/3
A || B
A= $node->expandedB= $self->top->_accum_state->{'show_always'}
| |||||||||||||||||||||||||||||
| 73 | } | ||||||||||||||||||||||||||||
| 74 | |||||||||||||||||||||||||||||
| 75 | |||||||||||||||||||||||||||||
| 76 | 3 | 1; | |||||||||||||||||||||||||||
| 77 | |||||||||||||||||||||||||||||
| 78 | __END__ | ||||||||||||||||||||||||||||