lib/Kwiki/Icons.pm

filter: Statementstmt 38.1% 16 / 42 Branchbran 0.0% 0 / 4 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 36.3% 4 / 11 Podpod 14.2% 1 / 7 totaltotal 30.4% 21 / 69 CC 4 SCAR 14.9
CC
4
Cov
33%
init
12.0
correct_template_path
6.0
class_title
2.0
CRAP 4.4
« lib/Kwiki/Plugin.pm ↑ Summary lib/Kwiki/Formatter.pm »
1 package Kwiki::Icons;
2 1 ▶use Kwiki::Plugin -Base;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 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
4  
5 1 const class_id => 'icons';
6 1 const css_file => 'icons.css';
7 1 const config_file => 'icons.yaml';
8  
9 0 ▶sub class_title {
Subroutine class_title: not called CC=1 SCAR=6.9
Pod undocumented
10 0 $self->usage;
11 }
12  
13 0 ▶sub register {
Subroutine register: not called CC=1 SCAR=6.9
Pod undocumented
14 0 my $registry = shift;
15 0 $registry->add(preload => 'icons');
16 0 $registry->add(preference => $self->use_icons);
17 }
18  
19 0 ▶sub init {
Subroutine init: not called CC=3 SCAR=24.8
Pod documented
20 0 super;
21 0 ▶ if ($self->preferences->can('use_icons') and
Branch: 1 branch
BranchTrueFalseTotal
if ($self->preferences->can("use_icons") and $self->preferences->use_icons->value) 0 0 0
Condition0%0/3
$self->preferences->can("use_icons") and $self->preferences->use_icons->value
!ll&&!rl&&r
000
MC/DC0%0/2
$self->preferences->can("use_icons") and $self->preferences->use_icons->value
$self->preferences->can("use_icons") $self->preferences->use_icons->value
Truth table0%0/3
A and B
A= $self->preferences->can("use_icons")B= $self->preferences->use_icons->value
ABresult
0X0
100
111
22 $self->preferences->use_icons->value) {
23 0 $self->template->add_path($self->icons_path);
24 }
25 }
26  
27 0 ▶sub use_icons {
Subroutine use_icons: not called CC=1 SCAR=6.9
Pod undocumented
28 0 my $p = $self->new_preference('use_icons');
29 0 $p->query('Use icons in toolbar?');
30 0 $p->type('boolean');
31 0 $p->edit('correct_template_path');
32 0 $p->default(1);
33 0 return $p;
34 }
35  
36 0 ▶sub correct_template_path {
Subroutine correct_template_path: not called CC=2 SCAR=17.9
Pod undocumented
37 0 my $pref = shift;
38 0 ▶ if ($pref->new_value) {
Branch: 1 branch
BranchTrueFalseTotal
if ($pref->new_value) { } 0 0 0
39 0 $self->template->add_path($self->icons_path);
40 }
41 else {
42 0 $self->template->remove_path($self->icons_path);
43 }
44 }
45  
46 0 ▶sub icons_path {
Subroutine icons_path: not called CC=1 SCAR=6.9
Pod undocumented
47 0 $self->usage;
48 }
49  
50 0 ▶sub usage {
Subroutine usage: not called CC=1 SCAR=6.9
Pod undocumented
51 0 die "Don't use Kwiki::Icons directly. Use a subclass of it.";
52 }
53  
54 1 __DATA__
« lib/Kwiki/Plugin.pm ↑ Summary lib/Kwiki/Formatter.pm »