NavMenu/Iterator/NavMenu/HeaderRole.pm

filter: Statementstmt 100% 27 / 27 Branchbran 100% 8 / 8 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 6 / 6 Podpod n/a totaltotal 100% 41 / 41 CC 5 SCAR 6.9
CC
5
Cov
100%
_start_handle_role
3.0
_start_handle_non_role
2.0
_end_handle_role
2.0
CRAP 2.0
« NavMenu/Iterator/Html/Item.pm ↑ Summary NavMenu/Tree/Iterator/Item.pm »
1 package HTML::Widgets::NavMenu::Iterator::NavMenu::HeaderRole;
2 3 $HTML::Widgets::NavMenu::Iterator::NavMenu::HeaderRole::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 parent qw(HTML::Widgets::NavMenu::Iterator::NavMenu);
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 3 __PACKAGE__->mk_acc_ref(
9 [
10 qw(
11 _was_role
12 )
13 ]
14 );
15  
16  
17 sub _start_handle_non_role
18 15 ▶{
Subroutine _start_handle_non_role: called CC=2 SCAR=6.9
19 15 my $self = shift;
20  
21 15 ▶ if ( $self->_was_role() )
Branch: 1 branch
BranchTrueFalseTotal
if ($self->_was_role) 3 12 15
22 {
23 3 $self->_add_tags(
24 $self->gen_ul_tag( { 'depth' => $self->stack->len() - 2 } ) );
25 }
26  
27 15 $self->_was_role(0);
28  
29 15 return $self->SUPER::_start_handle_non_role();
30 }
31  
32 sub _start_handle_role
33 7 ▶{
Subroutine _start_handle_role: called CC=3 SCAR=11.0
34 7 my $self = shift;
35 7 ▶ if ( $self->get_role() eq "header" )
Branch: 1 branch
BranchTrueFalseTotal
if ($self->get_role eq 'header') { } 4 3 7
36 {
37 4 ▶ if ( !$self->_was_role() )
Branch: 1 branch
BranchTrueFalseTotal
unless ($self->_was_role) 3 1 4
38 {
39 3 $self->_add_tags("</ul>");
40 }
41 4 $self->_add_tags( "<h2>", $self->get_link_tag(), "</h2>", );
42  
43 4 $self->_was_role(1);
44 }
45 else
46 {
47 3 return $self->SUPER::_start_handle_role();
48 }
49 }
50  
51  
52 sub _end_handle_role
53 7 ▶{
Subroutine _end_handle_role: called CC=2 SCAR=6.9
54 7 my $self = shift;
55 7 ▶ if ( $self->get_role() eq "header" )
Branch: 1 branch
BranchTrueFalseTotal
if ($self->get_role eq 'header') { } 4 3 7
56 {
57 # Do nothing;
58 }
59 else
60 {
61 3 return $self->SUPER::_end_handle_role();
62 }
63 }
64  
65  
66 3 1;
67  
68 __END__
« NavMenu/Iterator/Html/Item.pm ↑ Summary NavMenu/Tree/Iterator/Item.pm »