Perldoc/Reader.pm

filter: Statementstmt 61.7% 21 / 34 Branchbran 25.0% 1 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 62.5% 5 / 8 Podpod 0.0% 0 / 1 totaltotal 57.4% 27 / 47 CC 4 SCAR 9.8
CC
4
Cov
58%
_all_filepath
6.0
all
3.1
_all_stringref
2.0
CRAP 2.7
« Perldoc/Emitter/HTML.pm ↑ Summary Perldoc.pm »
1 package Perldoc::Reader;
2 1 ▶use Perldoc::Base -Base;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 1 ▶ 
Subroutine BEGIN: called CC=1 SCAR=0.0
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 field 'string';
5 1 field 'stringref';
6 1 field 'filehandle';
7 1 field 'filepath';
8  
9 1 ▶sub all {
Subroutine all: called CC=3 SCAR=11.4
Pod undocumented
10 1 for my $source (qw(string stringref filepath filehandle)) {
11 1 ▶ if (defined $self->{$source}) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $self->{$source}) 1 0 1
12 1 my $method = "_all_$source";
13 1 return $self->$method();
14 }
15 }
16 0 die "No input to read";
17 }
18  
19 1 ▶sub _all_string {
Subroutine _all_string: called CC=1 SCAR=0.0
20 1 return $self->string;
21 }
22  
23 0 ▶sub _all_stringref {
Subroutine _all_stringref: not called CC=1 SCAR=6.9
24 0 return ${$self->stringref};
25 }
26  
27 0 ▶sub _all_filepath {
Subroutine _all_filepath: not called CC=2 SCAR=17.9
28 0 my $filepath = $self->filepath;
29 0 ▶ open my $input, $filepath
Branch: 1 branch
BranchTrueFalseTotal
open my $input, $filepath or die "Can't open '${filepath}' for input:\n$!" 0 0 0
30 or die "Can't open '$filepath' for input:\n$!";
31 0 local $/;
32 return <$input>
33 0 }
34  
35 0 ▶sub _all_filehandle {
Subroutine _all_filehandle: not called CC=1 SCAR=6.9
36 0 my $filehandle = $self->filehandle;
37 0 local $/;
38 0 return <$filehandle>;
39 }
40  
41 =head1 NAME
42  
43 Perldoc::Reader - Reader Class for Perldoc Parsers
44  
45 =head1 SYNOPSIS
46  
47 package Perldoc::Reader;
48  
49 =head1 DESCRIPTION
50  
51 Uniform reading interface.
52  
53 XXX - Should be a mixin for Parsers.
54  
55 =head1 AUTHOR
56  
57 Ingy döt Net <ingy@cpan.org>
58  
59 Audrey wrote the original code for this parser.
60  
61 =head1 COPYRIGHT
62  
63 Copyright (c) 2006. Ingy döt Net. All rights reserved.
64  
65 This program is free software; you can redistribute it and/or modify it
66 under the same terms as Perl itself.
67  
68 See L<http://www.perl.com/perl/misc/Artistic.html>
69  
70 =cut
« Perldoc/Emitter/HTML.pm ↑ Summary Perldoc.pm »