blib/lib/Kwiki/ListPages.pm

filter: Statementstmt 56.6% 17 / 30 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 66.6% 4 / 6 Podpod 0.0% 0 / 2 totaltotal 55.2% 21 / 38 CC 3 SCAR 16.6
CC
3
Cov
57%
list_pages
12.0
register
2.0
BEGIN
1.0
CRAP 5.2
↑ Summary
1 package Kwiki::ListPages;
2  
3 1 ▶use Kwiki::Plugin -Base;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use mixin 'Kwiki::Installer';
Subroutine BEGIN: called CC=1 SCAR=0.0
Subroutine BEGIN: called CC=1 SCAR=0.0
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 1 our $VERSION = '0.11';
7  
8 1 const class_title => 'List Pages';
9 1 const class_id => 'list_pages';
10 1 const css_file => 'list_pages.css';
11  
12 sub register
13 0 ▶{
Subroutine register: not called CC=1 SCAR=6.9
Pod undocumented
14 0 my $registry = shift;
15 0 $registry->add( action => 'list_pages' );
16 0 $registry->add( toolbar => 'ListPages',
17 template => 'list_pages_button.html' );
18 }
19  
20 sub list_pages
21 0 ▶{
Subroutine list_pages: not called CC=3 SCAR=24.8
Pod undocumented
22 0 my $pages = {};
23 0 my $all_pages = [];
24 0 $pages->{$_} = [] foreach( 'A'..'Z', 0..9 );
25 0 @$all_pages = sort $self->pages->all;
26 0 foreach my $page (@$all_pages) {
27 0 push(@{$pages->{ uc(substr($page->{id},0,1)) }}, $page);
28 }
29 0 $self->render_screen( pages => $pages );
30 }
31  
32 1 __DATA__
↑ Summary