blib/lib/PLS/Parser/Pod/Package.pm

filter: Statementstmt 29.4% 10 / 34 Branchbran 0.0% 0 / 10 Conditioncond 0.0% 0 / 2 MC/DCmcdc 0.0% 0 / 1 Subroutinesub 60.0% 3 / 5 Podpod 0.0% 0 / 2 totaltotal 24.0% 13 / 54 CC 8 SCAR 38.8
CC
8
Cov
22%
find
72.0
new
2.0
BEGIN
1.0
CRAP 48.4
« blib/lib/PLS/Parser/Element.pm ↑ Summary blib/lib/PLS/Server/Request/Workspace/DidChangeWatchedFiles.pm »
1 package PLS::Parser::Pod::Package;
2  
3 15 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 15 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 15 ▶use parent 'PLS::Parser::Pod';
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 =head1 NAME
9  
10 PLS::Parser::Pod::Package
11  
12 =head1 DESCRIPTION
13  
14 This is a subclass of L<PLS::Parser::Pod>, used to find POD for a package.
15  
16 =cut
17  
18 sub new
19 0 ▶{
Subroutine new: not called CC=1 SCAR=6.9
Pod undocumented
20 0 my ($class, @args) = @_;
21  
22 0 my %args = @args;
23 0 my $self = $class->SUPER::new(%args);
24 0 $self->{package} = $args{package};
25  
26 0 return $self;
27 } ## end sub new
28  
29 sub find
30 0 ▶{
Subroutine find: not called CC=8 SCAR=42.8
Pod undocumented
31 0 my ($self) = @_;
32  
33 0 my $definitions;
34 0 ▶ $definitions = $self->{index}->find_package($self->{package}) if (ref $self->{index} eq 'PLS::Parser::Index');
Branch: 1 branch
BranchTrueFalseTotal
if ref $self->{"index"} eq "PLS::Parser::Index" 0 0 0
35  
36 0 ▶ if (ref $definitions eq 'ARRAY' and scalar @{$definitions})
Branch: 1 branch
BranchTrueFalseTotal
if (ref $definitions eq "ARRAY" and scalar @{$definitions;}) 0 0 0
Condition0%0/2
ref $definitions eq "ARRAY" and scalar @{$definitions;}
!ll
00
MC/DC0%0/1
ref $definitions eq "ARRAY" and scalar @{$definitions;}
ref $definitions eq "ARRAY"
Truth table0%0/2
A
A= ref $definitions eq "ARRAY"
Aresult
00
11
37 {
38 0 foreach my $definition (@{$definitions})
39 {
40 0 my $path = URI->new($definition->{uri})->file;
41 0 ▶ open my $fh, '<', $path or next;
Branch: 1 branch
BranchTrueFalseTotal
open my $fh, "<", $path or next 0 0 0
42 0 my $text = do { local $/; <$fh> };
43 0 my ($ok, $markdown) = $self->get_markdown_from_text(\$text);
44  
45 0 ▶ if ($ok)
Branch: 1 branch
BranchTrueFalseTotal
if ($ok) 0 0 0
46 {
47 0 $self->{markdown} = $markdown;
48 0 return 1;
49 }
50 } ## end foreach my $definition (@{$definitions...})
51 } ## end if (ref $definitions eq...)
52  
53 0 my ($ok, $markdown) = $self->get_markdown_for_package($self->{package});
54 0 ▶ $self->{markdown} = $markdown if $ok;
Branch: 1 branch
BranchTrueFalseTotal
if $ok 0 0 0
55  
56 0 return $ok;
57 } ## end sub find
58  
59 15 1;
« blib/lib/PLS/Parser/Element.pm ↑ Summary blib/lib/PLS/Server/Request/Workspace/DidChangeWatchedFiles.pm »