| 1 | # This code is part of Perl distribution OODoc version 3.05. | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 2 | # The POD got stripped from this file by OODoc version 3.05. | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 3 | # For contributors see file ChangeLog. | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 4 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 5 | # This software is copyright (c) 2003-2025 by Mark Overmeer. | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 7 | # This is free software; you can redistribute it and/or modify it under | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 8 | # the same terms as the Perl 5 programming language system itself. | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 9 | # SPDX-License-Identifier: Artistic-1.0-Perl OR GPL-1.0-or-later | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 10 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 12 | package OODoc::Format::Pod3;{ | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 13 | 1 | our $VERSION = '3.05'; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 14 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 15 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 16 | 1 | ▶ | use parent 'OODoc::Format::Pod'; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 17 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 18 | 1 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 19 | 1 | ▶ | use warnings; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 20 | 1 | ▶ | use utf8; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 21 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 22 | 1 | ▶ | use Log::Report 'oodoc'; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 23 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 24 | 1 | ▶ | use OODoc::Template (); | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 25 | 1 | ▶ | use List::Util qw/first/; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 26 | 1 | ▶ | use Encode qw/decode/; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 27 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 28 | #-------------------- | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 29 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 30 | sub init($) | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 31 | 0 | ▶ | { my ($self, $args) = @_; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
init: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 32 | 0 | ▶ | $args->{format} //= 'pod3'; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/2
$args->{"format"} //= "pod3"
MC/DC0%0/1
$args->{"format"} //= "pod3"
$args->{"format"}
Truth table0%0/2
A
A= $args->{"format"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 33 | 0 | $self->SUPER::init($args); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 34 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 35 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 36 | #-------------------- | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 37 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 38 | 1 | my $default_template; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 39 | 1 | { local $/; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 40 | 1 | $default_template = <DATA>; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 41 | 1 | close DATA; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 42 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 43 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 44 | sub createManual(@) | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 45 | 0 | ▶ | { my ($self, %args) = @_; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
createManual: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 46 | 0 | ▶ | $self->{OFP_template} = delete $args{template} || \$default_template; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/2
delete $args{'template'} || \$default_template
MC/DC0%0/1
delete $args{'template'} || \$default_template
delete $args{'template'}
Truth table0%0/2
A
A= delete $args{'template'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 47 | 0 | $self->SUPER::createManual(%args); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 48 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 49 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 50 | sub _formatManual(@) | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 51 | 0 | ▶ | { my ($self, %args) = @_; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_formatManual: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 52 | 0 | my $output = delete $args{output}; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 53 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 54 | my $template = OODoc::Template->new( | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 55 | markers => [ '<{', '}>' ], | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 56 | manual_obj => delete $args{manual}, | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 57 | 0 | chapter_order => [ qw/ | |||||||||||||||||||||||||||||||||||||||||||||||||
| 58 | NAME INHERITANCE SYNOPSIS DESCRIPTION OVERLOADED METHODS | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 59 | FUNCTIONS CONSTANTS EXPORTS DIAGNOSTICS DETAILS REFERENCES | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 60 | COPYRIGHTS | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 61 | / ], | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 62 | %args, | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 63 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 64 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 65 | $output->print(scalar $template->process( | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 66 | $self->{OFP_template}, | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 67 | 0 | ▶ | manual => sub { shift; ( {}, @_ ) }, | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 68 | 0 | ▶ | chapters => sub { $self->chapters($template, @_) }, | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 69 | 0 | ▶ | sections => sub { $self->sections($template, @_) }, | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 70 | 0 | ▶ | subsections => sub { $self->subsections($template, @_) }, | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 71 | 0 | ▶ | subsubsections => sub { $self->subsubsections($template, @_) }, | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 72 | 0 | ▶ | subroutines => sub { $self->subroutines($template, @_) }, | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 73 | 0 | ▶ | diagnostics => sub { $self->diagnostics($template, @_) }, | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 74 | 0 | )); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 75 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 76 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 77 | sub structure($$$) | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 78 | 0 | ▶ | { my ($self, $template, $type, $object) = @_; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
structure: not called CC=8 SCAR=42.8
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 79 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 80 | 0 | my $manual = $template->valueFor('manual_obj'); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 81 | 0 | my $descr = $self->cleanup($manual, $object->description); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 82 | 0 | my $name = $object->name; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 83 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 84 | 0 | ▶ | $descr =~ s/\n*$/\n\n/ | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
defined $descr and length $descr
MC/DC0%0/2
defined $descr and length $descr
defined $descr
length $descr
Truth table0%0/3
A and B
A= defined $descrB= length $descr
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 85 | if defined $descr && length $descr; | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 86 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 87 | 0 | my @examples; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 88 | 0 | foreach my $example ($object->examples) | |||||||||||||||||||||||||||||||||||||||||||||||||
| 89 | 0 | ▶ | { my $title = $example->name || 'Example'; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/2
$example->name || 'Example'
MC/DC0%0/1
$example->name || 'Example'
$example->name
Truth table0%0/2
A
A= $example->name
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 90 | 0 | ▶ | $title = "Example: $example" if $title !~ /example/i; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 91 | 0 | $title =~ s/\s+$//; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 92 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 93 | 0 | push @examples, +{ | |||||||||||||||||||||||||||||||||||||||||||||||||
| 94 | title => $title, | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 95 | descr => $self->cleanup($manual, $example->description) | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 96 | }; | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 97 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 98 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 99 | 0 | my @extends; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 100 | 0 | ▶ | @extends = map +{manual => $_->manual, header => $name}, $object->extends | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$name ne "NAME" and $name ne "SYNOPSIS"
MC/DC0%0/2
$name ne "NAME" and $name ne "SYNOPSIS"
$name ne "NAME"
$name ne "SYNOPSIS"
Truth table0%0/3
A and B
A= $name ne "NAME"B= $name ne "SYNOPSIS"
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 101 | if $name ne 'NAME' && $name ne 'SYNOPSIS'; | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 102 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 103 | 0 | +{ $type => $name, | |||||||||||||||||||||||||||||||||||||||||||||||||
| 104 | $type.'_obj' => $object, | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 105 | description => $descr, | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 106 | examples => \@examples, | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 107 | extends => \@extends, | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 108 | }; | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 109 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 110 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 111 | sub chapters($$$$$) | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 112 | 0 | ▶ | { my ($self, $template, $tag, $attrs, $then, $else) = @_; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
chapters: not called CC=6 SCAR=37.4
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 113 | 0 | my $manual = $template->valueFor('manual_obj'); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 114 | 0 | my @chapters = map $self->structure($template, chapter => $_), $manual->chapters; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 115 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 116 | 0 | ▶ | if(my $order = $attrs->{order}) | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 117 | 0 | ▶ | { my @order = ref $order eq 'ARRAY' ? @$order : split( /\,\s*/, $order); | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 118 | 0 | my %order; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 119 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 120 | # first the pre-defined names, then the other | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 121 | 0 | my $count = 1; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 122 | 0 | $order{$_} = $count++ for @order; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 123 | 0 | ▶ | $order{$_->{chapter}} ||= $count++ for @chapters; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/3
$order{$_->{"chapter"}} ||= $count++
MC/DC0%0/2
$order{$_->{"chapter"}} ||= $count++
$order{$_->{"chapter"}}
$count++
Truth table0%0/3
A ||= B
A= $order{$_->{"chapter"}}B= $count++
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 124 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 125 | 0 | @chapters = sort { $order{$a->{chapter}} <=> $order{$b->{chapter}} } @chapters; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 126 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 127 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 128 | 0 | ( \@chapters, $attrs, $then, $else ); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 129 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 130 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 131 | sub sections($$$$$) | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 132 | 0 | ▶ | { my ($self, $template, $tag, $attrs, $then, $else) = @_; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
sections: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 133 | 0 | my $chapter = $template->valueFor('chapter_obj'); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 134 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 135 | 0 | ▶ | first {!$_->isEmpty} $chapter->sections | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 136 | or return ([], $attrs, $then, $else); | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 137 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 138 | 0 | my @sections = map $self->structure($template, section => $_), $chapter->sections; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 139 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 140 | 0 | ( \@sections, $attrs, $then, $else ); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 141 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 142 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 143 | sub subsections($$$$$) | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 144 | 0 | ▶ | { my ($self, $template, $tag, $attrs, $then, $else) = @_; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
subsections: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 145 | 0 | my $section = $template->valueFor('section_obj'); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 146 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 147 | 0 | ▶ | first {!$_->isEmpty} $section->subsections | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 148 | or return ([], $attrs, $then, $else); | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 149 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 150 | 0 | my @subsections = map $self->structure($template, subsection => $_), $section->subsections; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 151 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 152 | 0 | ( \@subsections, $attrs, $then, $else ); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 153 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 154 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 155 | sub subsubsections($$$$$) | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 156 | 0 | ▶ | { my ($self, $template, $tag, $attrs, $then, $else) = @_; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
subsubsections: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 157 | 0 | my $subsection = $template->valueFor('subsection_obj'); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 158 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 159 | 0 | ▶ | first {!$_->isEmpty} $subsection->subsubsections | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 160 | or return ([], $attrs, $then, $else); | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 161 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 162 | 0 | my @subsubsections = map $self->structure($template, subsubsection => $_), $subsection->subsubsections; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 163 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 164 | 0 | ( \@subsubsections, $attrs, $then, $else ); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 165 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 166 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 167 | sub subroutines($$$$$$) | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 168 | 0 | ▶ | { my ($self, $template, $tag, $attrs, $then, $else) = @_; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
subroutines: not called CC=6 SCAR=37.4
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 169 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 170 | 0 | ▶ | my $parent | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/9
$template->valueFor('subsubsection_obj') || $template->valueFor('subsection_obj') || $template->valueFor('section_obj') || $template->valueFor('chapter_obj')
$template->valueFor("subsubsection_obj") or $template->valueFor("subsection_obj") or $template->valueFor("section_obj")
$template->valueFor("subsubsection_obj") or $template->valueFor("subsection_obj")
MC/DC0%0/4
$template->valueFor('subsubsection_obj') || $template->valueFor('subsection_obj') || $template->valueFor('section_obj') || $template->valueFor('chapter_obj')
$template->valueFor("subsubsection_obj")
$template->valueFor("subsection_obj")
$template->valueFor("section_obj")
$template->valueFor('chapter_obj')
Truth table0%0/5
A or B or C || D
A= $template->valueFor("subsubsection_obj")B= $template->valueFor("subsection_obj")C= $template->valueFor("section_obj")D= $template->valueFor('chapter_obj')
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 171 | = $template->valueFor('subsubsection_obj') | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 172 | || $template->valueFor('subsection_obj') | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 173 | || $template->valueFor('section_obj') | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 174 | || $template->valueFor('chapter_obj'); | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 175 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 176 | 0 | ▶ | defined $parent | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 177 | or return (); | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 178 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 179 | 0 | my $out = ''; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 180 | 0 | open my $fh, '>:encoding(utf8)', \$out; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 181 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 182 | 0 | my @show = map +($_ => scalar $template->valueFor($_)), qw/ | |||||||||||||||||||||||||||||||||||||||||||||||||
| 183 | show_described_options show_described_subs show_diagnostics | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 184 | show_examples show_inherited_options show_inherited_subs | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 185 | show_option_table show_subs_index | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 186 | /; | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 187 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 188 | # This is quite weak: the whole POD section for a sub description | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 189 | # is produced outside the template. In the future, this may get | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 190 | # changed: if there is a need for it: of course, we can do everything | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 191 | # in the template system. | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 192 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 193 | 0 | $self->showSubroutines( | |||||||||||||||||||||||||||||||||||||||||||||||||
| 194 | subroutines => [ $parent->subroutines ], | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 195 | manual => $parent->manual, | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 196 | output => $fh, | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 197 | @show, | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 198 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 199 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 200 | 0 | $fh->close; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 201 | 0 | ▶ | length $out or return (); | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 202 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 203 | 0 | $out =~ s/\n*$/\n\n/; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 204 | 0 | decode 'UTF-8', $out; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 205 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 206 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 207 | sub diagnostics($$$$$$) | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 208 | 0 | ▶ | { my ($self, $template, $tag, $attrs, $then, $else) = @_; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
diagnostics: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 209 | 0 | my $manual = $template->valueFor('manual_obj'); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 210 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 211 | 0 | my $out = ''; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 212 | 0 | open my $fh, '>:encoding(utf8)', \$out; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 213 | 0 | $self->chapterDiagnostics(%$attrs, manual => $manual, output => $fh); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 214 | 0 | $fh->close; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 215 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 216 | 0 | $out =~ s/\n*$/\n\n/; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 217 | 0 | decode 'UTF-8', $out; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 218 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 219 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 220 | 1 | 1; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 221 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 222 | __DATA__ | ||||||||||||||||||||||||||||||||||||||||||||||||||