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

filter: Statementstmt 37.1% 13 / 35 Branchbran 0.0% 0 / 6 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 66.6% 4 / 6 Podpod 0.0% 0 / 2 totaltotal 34.6% 17 / 49 CC 4 SCAR 22.6
CC
4
Cov
32%
find
20.0
new
2.0
BEGIN
1.0
CRAP 9.6
« blib/lib/PLS/JSON.pm ↑ Summary blib/lib/PLS/Server/Cache.pm »
1 package PLS::Parser::Pod::Variable;
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 15 ▶use Pod::Simple::Search;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 =head1 NAME
11  
12 PLS::Parser::Pod::Variable
13  
14 =head1 DESCRIPTION
15  
16 This is a subclass of L<PLS::Parser::Pod> for finding POD for a Perl builtin variable.
17  
18 =cut
19  
20 sub new
21 0 ▶{
Subroutine new: not called CC=1 SCAR=6.9
Pod undocumented
22 0 my ($class, @args) = @_;
23  
24 0 my %args = @args;
25 0 my $self = $class->SUPER::new(%args);
26 0 $self->{variable} = $args{variable};
27 0 $self->{package} = $args{package};
28  
29 0 return $self;
30 } ## end sub new
31  
32 sub find
33 0 ▶{
Subroutine find: not called CC=4 SCAR=30.0
Pod undocumented
34 0 my ($self) = @_;
35  
36 0 my ($ok, $markdown) = $self->run_perldoc_command('-Tuv', $self->{variable});
37  
38 0 ▶ if ($ok)
Branch: 1 branch
BranchTrueFalseTotal
if ($ok) 0 0 0
39 {
40 0 $self->{markdown} = $markdown;
41 0 return 1;
42 }
43  
44 0 ▶ return 0 unless (length $self->{package});
Branch: 1 branch
BranchTrueFalseTotal
unless length $self->{"package"} 0 0 0
45  
46 0 my $search = Pod::Simple::Search->new();
47 0 my $include = $self->get_clean_inc();
48 0 $search->inc(0);
49 0 my $path = $search->find($self->{package}, @{$include});
50 0 ($ok, $markdown) = $self->find_pod_in_file($path, $self->{variable});
51  
52 0 ▶ if ($ok)
Branch: 1 branch
BranchTrueFalseTotal
if ($ok) 0 0 0
53 {
54 0 $self->{markdown} = $markdown;
55 0 return 1;
56 }
57  
58 0 return 0;
59 } ## end sub find
60  
61 15 1;
« blib/lib/PLS/JSON.pm ↑ Summary blib/lib/PLS/Server/Cache.pm »