| 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::Text::SubSection; | ||||||||||||||||||||||||||||
| 9 | 1 | ▶ | use vars '$VERSION'; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 10 | 1 | $VERSION = '2.02'; | |||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||
| 12 | 1 | ▶ | use base 'OODoc::Text::Structure'; | ||||||||||||||||||||||||||
|
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 | |||||||||||||||||||||||||||||
| 19 | |||||||||||||||||||||||||||||
| 20 | sub init($) | ||||||||||||||||||||||||||||
| 21 | 0 | ▶ | { my ($self, $args) = @_; | ||||||||||||||||||||||||||
|
Subroutine
init: not called CC=6 SCAR=37.4
Pod
undocumented
| |||||||||||||||||||||||||||||
| 22 | 0 | ▶ | $args->{type} ||= 'Subsection'; | ||||||||||||||||||||||||||
|
Condition0%0/2
$args->{"type"} ||= "Subsection"
MC/DC0%0/1
$args->{"type"} ||= "Subsection"
$args->{"type"}
Truth table0%0/2
A
A= $args->{"type"}
| |||||||||||||||||||||||||||||
| 23 | 0 | ▶ | $args->{container} ||= delete $args->{section} or panic; | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$args->{"container"} ||= delete $args->{"section"}
MC/DC0%0/2
$args->{"container"} ||= delete $args->{"section"}
$args->{"container"}
delete $args->{"section"}
Truth table0%0/3
A ||= B
A= $args->{"container"}B= delete $args->{"section"}
| |||||||||||||||||||||||||||||
| 24 | 0 | ▶ | $args->{level} ||= 3; | ||||||||||||||||||||||||||
|
Condition0%0/2
$args->{"level"} ||= 3
MC/DC0%0/1
$args->{"level"} ||= 3
$args->{"level"}
Truth table0%0/2
A
A= $args->{"level"}
| |||||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||
| 26 | 0 | ▶ | $self->SUPER::init($args) or return; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 27 | 0 | $self->{OTS_subsubsections} = []; | |||||||||||||||||||||||||||
| 28 | 0 | $self; | |||||||||||||||||||||||||||
| 29 | } | ||||||||||||||||||||||||||||
| 30 | |||||||||||||||||||||||||||||
| 31 | sub emptyExtension($) | ||||||||||||||||||||||||||||
| 32 | 0 | ▶ | { my ($self, $container) = @_; | ||||||||||||||||||||||||||
|
Subroutine
emptyExtension: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||
| 33 | 0 | my $empty = $self->SUPER::emptyExtension($container); | |||||||||||||||||||||||||||
| 34 | 0 | my @subsub = map $_->emptyExtension($empty), $self->subsubsections; | |||||||||||||||||||||||||||
| 35 | 0 | $empty->subsubsections(@subsub); | |||||||||||||||||||||||||||
| 36 | 0 | $empty; | |||||||||||||||||||||||||||
| 37 | } | ||||||||||||||||||||||||||||
| 38 | |||||||||||||||||||||||||||||
| 39 | sub findEntry($) | ||||||||||||||||||||||||||||
| 40 | 0 | ▶ | { my ($self, $name) = @_; | ||||||||||||||||||||||||||
|
Subroutine
findEntry: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||||||||||||||||||
| 41 | 0 | ▶ | $self->name eq $name ? $self : (); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 42 | } | ||||||||||||||||||||||||||||
| 43 | |||||||||||||||||||||||||||||
| 44 | #------------------------------------------- | ||||||||||||||||||||||||||||
| 45 | |||||||||||||||||||||||||||||
| 46 | |||||||||||||||||||||||||||||
| 47 | 0 | ▶ | sub section() { shift->container } | ||||||||||||||||||||||||||
|
Subroutine
section: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||
| 48 | |||||||||||||||||||||||||||||
| 49 | |||||||||||||||||||||||||||||
| 50 | 0 | ▶ | sub chapter() { shift->section->chapter } | ||||||||||||||||||||||||||
|
Subroutine
chapter: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||
| 51 | |||||||||||||||||||||||||||||
| 52 | sub path() | ||||||||||||||||||||||||||||
| 53 | 0 | ▶ | { my $self = shift; | ||||||||||||||||||||||||||
|
Subroutine
path: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||
| 54 | 0 | $self->section->path . '/' . $self->name; | |||||||||||||||||||||||||||
| 55 | } | ||||||||||||||||||||||||||||
| 56 | |||||||||||||||||||||||||||||
| 57 | #------------------------------------------- | ||||||||||||||||||||||||||||
| 58 | |||||||||||||||||||||||||||||
| 59 | |||||||||||||||||||||||||||||
| 60 | sub subsubsection($) | ||||||||||||||||||||||||||||
| 61 | 0 | ▶ | { my ($self, $thing) = @_; | ||||||||||||||||||||||||||
|
Subroutine
subsubsection: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||||||||||||||||||
| 62 | |||||||||||||||||||||||||||||
| 63 | 0 | ▶ | if(ref $thing) | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 64 | 0 | { push @{$self->{OTS_subsubsections}}, $thing; | |||||||||||||||||||||||||||
| 65 | 0 | return $thing; | |||||||||||||||||||||||||||
| 66 | } | ||||||||||||||||||||||||||||
| 67 | |||||||||||||||||||||||||||||
| 68 | 0 | first {$_->name eq $thing} $self->subsubsections; | |||||||||||||||||||||||||||
| 69 | } | ||||||||||||||||||||||||||||
| 70 | |||||||||||||||||||||||||||||
| 71 | |||||||||||||||||||||||||||||
| 72 | sub subsubsections(;@) | ||||||||||||||||||||||||||||
| 73 | 0 | ▶ | { my $self = shift; | ||||||||||||||||||||||||||
|
Subroutine
subsubsections: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||||||||||||||||||||
| 74 | 0 | ▶ | if(@_) | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 75 | 0 | { $self->{OTS_subsubsections} = [ @_ ]; | |||||||||||||||||||||||||||
| 76 | 0 | $_->container($self) for @_; | |||||||||||||||||||||||||||
| 77 | } | ||||||||||||||||||||||||||||
| 78 | |||||||||||||||||||||||||||||
| 79 | 0 | @{$self->{OTS_subsubsections}}; | |||||||||||||||||||||||||||
| 80 | } | ||||||||||||||||||||||||||||
| 81 | |||||||||||||||||||||||||||||
| 82 | |||||||||||||||||||||||||||||
| 83 | 1 | 1; | |||||||||||||||||||||||||||
| 84 | |||||||||||||||||||||||||||||
| 85 | 1 | 1; | |||||||||||||||||||||||||||