lib/PPI/Transform/Doxygen/POD.pm

filter: Statementstmt 87.1% 34 / 39 Branchbran 50.0% 2 / 4 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 83.3% 10 / 12 Podpod 100% 6 / 6 totaltotal 78.7% 52 / 66 SCAR 18.5
CC
6
Cov
78%
view_seq_link
12.0
_escape
6.0
view_head2
2.0
CRAP 6.4
« blib/lib/PPI/Transform/Doxygen/POD.pm ↑ Summary
1 package PPI::Transform::Doxygen::POD;
2  
3 2 ▶use 5.010001;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 2 ▶use parent qw(Pod::POM::View::HTML);
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 2 our $VERSION = '0.33';
9  
10 2 our $PREFIX = '';
11  
12 sub view_pod {
13 20 ▶ my ($self, $pod) = @_;
Subroutine view_pod: called CC=1 SCAR=0.0
Pod documented
14 20 return $pod->content->present($self);
15 }
16  
17 sub view_head1 {
18 3 ▶ my ($self, $head1) = @_;
Subroutine view_head1: called CC=1 SCAR=0.0
Pod documented
19 3 my $title = $head1->title->present($self);
20 3 (my $name = $title) =~ s/\s/_/g;
21 3 return "\n\@section ${PREFIX}_$name $title\n" . $head1->content->present($self);
22 }
23  
24 sub view_head2 {
25 9 ▶ my ($self, $head2) = @_;
Subroutine view_head2: called CC=2 SCAR=6.9
Pod documented
26 9 my $title = $head2->title->present($self);
27 9 (my $name = $title) =~ s/\s/_/g;
28 9 ▶ my $sect = $title =~ /[\w:]+\s*\(.*\)/
Branch: 1 branch
BranchTrueFalseTotal
$title =~ /[\w:]+\s*\(.*\)/ ? : 8 1 9
29 ? "\n"
30 : "\n\@subsection $name $title\n";
31 9 return $sect . $head2->content->present($self);
32 }
33  
34 sub view_seq_code {
35 1 ▶ my ($self, $text) = @_;
Subroutine view_seq_code: called CC=1 SCAR=0.0
Pod documented
36 1 return qq(<span style="background-color:#eee;padding-left:0.5em;padding-right:0.5em;font-family:Monospace;font-weight: bold;">$text</span>);
37 }
38  
39 sub view_verbatim {
40 1 ▶ my ($self, $text) = @_;
Subroutine view_verbatim: called CC=1 SCAR=0.0
Pod documented
41 1 _unescape($text);
42 1 return "\n\@code\n$text\n\@endcode\n";
43 }
44  
45 sub view_seq_link {
46 0 ▶ my ($self, $link) = @_;
Subroutine view_seq_link: not called CC=3 SCAR=24.8
Pod documented
47 0 my($title, $pre) = split(/\|/, $link);
48 0 ▶ my $url = $pre && $pre =~ m(^\w+://)
Branch: 1 branch
BranchTrueFalseTotal
$pre && $pre =~ m[^\w+://] ? : 0 0 0
Condition0%0/3
$pre and $pre =~ m[^\w+://]
!ll&&!rl&&r
000
MC/DC0%0/2
$pre and $pre =~ m[^\w+://]
$pre $pre =~ m[^\w+://]
Truth table0%0/3
A and B
A= $preB= $pre =~ m[^\w+://]
ABresult
0X0
100
111
49 ? qq(<a href="$pre">$title</a>)
50 : $self->SUPER::view_seq_link($link);
51 0 return $url;
52 }
53  
54 2 my %XML_TO = (
55 '&' => '&amp;',
56 '<' => '&lt;',
57 '>' => '&gt;',
58 '"' => '&quot;',
59 '\'' => '&#39;'
60 );
61 2 my %XML_FROM = reverse %XML_TO;
62  
63 sub _unescape {
64 1 ▶ $_[0] =~ s!\Q$_!$XML_FROM{$_}!g for keys %XML_FROM;
Subroutine _unescape: called CC=2 SCAR=6.9
65 1 $_[0] =~ s!\\(\@|\\|\%|#)!$1!g;
66 }
67  
68 sub _escape {
69 0 ▶ $_[0] =~ s!\Q$_!$XML_TO{$_}!g for keys %XML_TO;
Subroutine _escape: not called CC=2 SCAR=17.9
70 }
71  
72  
73 2 1;
74  
75 __END__
« blib/lib/PPI/Transform/Doxygen/POD.pm ↑ Summary