lib/OODoc/Parser.pm

filter: Statementstmt 54.0% 20 / 37 Branchbran 0.0% 0 / 12 Conditioncond 0.0% 0 / 5 MC/DCmcdc 0.0% 0 / 3 Subroutinesub 54.5% 6 / 11 Podpod 75.0% 3 / 4 totaltotal 40.2% 29 / 72 SCAR 33.7
CC
9
Cov
37%
init
30.0
cleanup
20.0
skipManualLink
6.0
CRAP 29.2
« blib/lib/OODoc/Text.pm ↑ Summary blib/lib/OODoc/Format/TemplateMagic.pm »
1 # Copyrights 2003-2021 by [Mark Overmeer].
2 # For other contributors see ChangeLog.
3 # See the manual pages for details on the licensing terms.
4 # Pod stripped from pm file by OODoc 2.02.
5 # This code is part of perl distribution OODoc. It is licensed under the
6 # same terms as Perl itself: https://spdx.org/licenses/Artistic-2.0.html
7  
8 package OODoc::Parser;
9 1 ▶use vars '$VERSION';
Subroutine BEGIN: called CC=1 SCAR=0.0
10 1 $VERSION = '2.02';
11  
12 1 ▶use base 'OODoc::Object';
Subroutine BEGIN: called CC=1 SCAR=0.0
13  
14 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
15 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
16  
17 1 ▶use Log::Report 'oodoc';
Subroutine BEGIN: called CC=1 SCAR=0.0
18 1 ▶use List::Util 'first';
Subroutine BEGIN: called CC=1 SCAR=0.0
19  
20  
21 #-------------------------------------------
22  
23  
24 sub init($)
25 0 ▶{ my ($self, $args) = @_;
Subroutine init: not called CC=5 SCAR=34.0
Pod undocumented
26 0 ▶ $self->SUPER::init($args) or return;
Branch: 1 branch
BranchTrueFalseTotal
$self->SUPER::init($args) or return 0 0 0
27  
28 0 ▶ my $skip = delete $args->{skip_links} || [];
Condition0%0/2
delete $args->{'skip_links'} || []
l!l
00
MC/DC0%0/1
delete $args->{'skip_links'} || []
delete $args->{'skip_links'}
Truth table0%0/2
A
A= delete $args->{'skip_links'}
Aresult
11
00
29 0 ▶ my @skip = map { ref $_ eq 'Regexp' ? $_ : qr/^\Q$_\E(?:\:\:|$)/ }
Branch: 2 branches
BranchTrueFalseTotal
ref $_ eq 'Regexp' ? : 0 0 0
ref $skip eq 'ARRAY' ? : 0 0 0
30 ref $skip eq 'ARRAY' ? @$skip : $skip;
31 0 $self->{skip_links} = \@skip;
32  
33 0 $self;
34 }
35  
36 #-------------------------------------------
37  
38  
39 0 ▶sub parse(@) {panic}
Subroutine parse: not called CC=1 SCAR=6.9
Pod documented
40  
41 #-------------------------------------------
42  
43  
44 sub skipManualLink($)
45 0 ▶{ my ($self, $package) = @_;
Subroutine skipManualLink: not called CC=2 SCAR=17.9
Pod documented
46 0 ▶ (first { $package =~ $_ } @{$self->{skip_links}}) ? 1 : 0;
Subroutine __ANON__: not called CC=1 SCAR=6.9
Branch: 1 branch
BranchTrueFalseTotal
&first(sub { $package =~ /$_/; } , @{$$self{'skip_links'};}) ? : 0 0 0
47 }
48  
49  
50 sub cleanup($$$)
51 0 ▶{ my ($self, $formatter, $manual, $string) = @_;
Subroutine cleanup: not called CC=4 SCAR=30.0
Pod documented
52  
53 0 ▶ return $self->cleanupPod($formatter, $manual, $string)
Branch: 1 branch
BranchTrueFalseTotal
if $formatter->isa("OODoc::Format::Pod") 0 0 0
54 if $formatter->isa('OODoc::Format::Pod');
55  
56 0 ▶ return $self->cleanupHtml($formatter, $manual, $string)
Branch: 1 branch
BranchTrueFalseTotal
if $formatter->isa("OODoc::Format::Html") or $formatter->isa("OODoc::Format::Html2") 0 0 0
Condition0%0/3
$formatter->isa("OODoc::Format::Html") or $formatter->isa("OODoc::Format::Html2")
l!l&&r!l&&!r
000
MC/DC0%0/2
$formatter->isa("OODoc::Format::Html") or $formatter->isa("OODoc::Format::Html2")
$formatter->isa("OODoc::Format::Html") $formatter->isa("OODoc::Format::Html2")
Truth table0%0/3
A or B
A= $formatter->isa("OODoc::Format::Html")B= $formatter->isa("OODoc::Format::Html2")
ABresult
1X1
011
000
57 if $formatter->isa('OODoc::Format::Html')
58 || $formatter->isa('OODoc::Format::Html2');
59  
60 0 error __x"the formatter type {type} is not known for cleanup"
61 , type => ref $formatter;
62  
63 0 $string;
64 }
65  
66  
67 1 1;
68  
« blib/lib/OODoc/Text.pm ↑ Summary blib/lib/OODoc/Format/TemplateMagic.pm »