Obj2HTML/Plugin/Base.pm

filter: Statementstmt 29.2% 12 / 41 Branchbran 0.0% 0 / 8 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 28.5% 2 / 7 Podpod n/a totaltotal 25.0% 14 / 56 SCAR 27.6
CC
5
Cov
24%
__ANON__
12.0
__ANON__
6.0
__ANON__
6.0
CRAP 15.8
« Obj2HTML/Plugin/SemanticUITabs.pm ↑ Summary
1 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
2 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
3  
4 HTML::Obj2HTML::register_extension("repeat", {
5 tag => "",
6 before => sub {
7 0 ▶ my $o = shift;
Subroutine __ANON__: not called CC=3 SCAR=24.8
8 0 my $ret = [];
9 0 ▶ if (!defined $o->{num}) { $o->{num} = 1; }
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $o->{"num"}) 0 0 0
10 0 ▶ for (my $i=0; $i<$o->{num}; $i++) {
Branch: 1 branch
BranchTrueFalseTotal
if ($i < $o->{"num"}) 0 0 0
11 0 push(@{$ret}, @{$o->{_}});
12 }
13 0 return $ret;
14 }
15 1 });
16  
17 HTML::Obj2HTML::register_extension("editable", {
18 tag => "",
19 before => sub {
20 0 ▶ my $o = shift;
Subroutine __ANON__: not called CC=1 SCAR=6.9
21 0 my $prevro = HTML::Obj2HTML::get_opt("readonly");
22 0 HTML::Obj2HTML::set_opt("readonly", 0);
23 0 my $ret = HTML::Obj2HTML::gen($o);
24 0 HTML::Obj2HTML::set_opt("readonly", $prevro);
25 0 return $ret;
26 }
27 1 });
28 HTML::Obj2HTML::register_extension("readonly", {
29 tag => "",
30 before => sub {
31 0 ▶ my $o = shift;
Subroutine __ANON__: not called CC=1 SCAR=6.9
32 0 my $prevro = HTML::Obj2HTML::get_opt("readonly");
33 0 HTML::Obj2HTML::set_opt("readonly", 1);
34 0 my $ret = HTML::Obj2HTML::gen($o);
35 0 HTML::Obj2HTML::set_opt("readonly", $prevro);
36 0 return $ret;
37 }
38 1 });
39  
40 HTML::Obj2HTML::register_extension("ifReadOnly", {
41 tag => "if",
42 before => sub {
43 0 ▶ my $o = shift;
Subroutine __ANON__: not called CC=2 SCAR=17.9
44 0 ▶ if (ref $o eq "HASH") {
Branch: 1 branch
BranchTrueFalseTotal
if (ref $o eq "HASH") 0 0 0
45 0 $o->{cond} = HTML::Obj2HTML::get_opt('readonly');
46 }
47 0 return "";
48 }
49 1 });
50 HTML::Obj2HTML::register_extension("ifEditable", {
51 tag => "if",
52 before => sub {
53 0 ▶ my $o = shift;
Subroutine __ANON__: not called CC=2 SCAR=17.9
54 0 ▶ if (ref $o eq "HASH") {
Branch: 1 branch
BranchTrueFalseTotal
if (ref $o eq "HASH") 0 0 0
55 0 $o->{cond} = !Obj2HTML::get_opt("readonly");
56 }
57 0 return "";
58 }
59 1 });
60  
61 1 1;
« Obj2HTML/Plugin/SemanticUITabs.pm ↑ Summary