| 1 | # Copyrights 2003-2015 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.01. | ||||||||||||||||||
| 5 | |||||||||||||||||||
| 6 | package OODoc::Text::Structure; | ||||||||||||||||||
| 7 | 1 | ▶ | use vars '$VERSION'; | ||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||
| 8 | 1 | $VERSION = '2.01'; | |||||||||||||||||
| 9 | |||||||||||||||||||
| 10 | 1 | ▶ | use base 'OODoc::Text'; | ||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||
| 11 | |||||||||||||||||||
| 12 | 1 | ▶ | use strict; | ||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||
| 13 | 1 | ▶ | use warnings; | ||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||
| 14 | |||||||||||||||||||
| 15 | 1 | ▶ | use Log::Report 'oodoc'; | ||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||
| 16 | 1 | ▶ | use List::Util 'first'; | ||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||
| 17 | |||||||||||||||||||
| 18 | |||||||||||||||||||
| 19 | sub init($) | ||||||||||||||||||
| 20 | 0 | ▶ | { my ($self, $args) = @_; | ||||||||||||||||
|
Subroutine
init: not called CC=3 SCAR=24.8
Pod
undocumented
| |||||||||||||||||||
| 21 | 0 | ▶ | $self->SUPER::init($args) or return; | ||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||
| 22 | 0 | $self->{OTS_subs} = []; | |||||||||||||||||
| 23 | $self->{OTS_level} = delete $args->{level} | ||||||||||||||||||
| 24 | 0 | ▶ | or panic "no level defined for structural component"; | ||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||
| 25 | 0 | $self; | |||||||||||||||||
| 26 | } | ||||||||||||||||||
| 27 | |||||||||||||||||||
| 28 | |||||||||||||||||||
| 29 | sub emptyExtension($) | ||||||||||||||||||
| 30 | 0 | ▶ | { my ($self, $container) = @_; | ||||||||||||||||
|
Subroutine
emptyExtension: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||
| 31 | |||||||||||||||||||
| 32 | 0 | my $new = ref($self)->new | |||||||||||||||||
| 33 | ( name => $self->name | ||||||||||||||||||
| 34 | , linenr => -1 | ||||||||||||||||||
| 35 | , level => $self->level | ||||||||||||||||||
| 36 | , container => $container | ||||||||||||||||||
| 37 | ); | ||||||||||||||||||
| 38 | 0 | $new->extends($self); | |||||||||||||||||
| 39 | 0 | $new; | |||||||||||||||||
| 40 | } | ||||||||||||||||||
| 41 | |||||||||||||||||||
| 42 | #------------------------------------------- | ||||||||||||||||||
| 43 | |||||||||||||||||||
| 44 | |||||||||||||||||||
| 45 | 0 | ▶ | sub level() {shift->{OTS_level}} | ||||||||||||||||
|
Subroutine
level: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||
| 46 | |||||||||||||||||||
| 47 | |||||||||||||||||||
| 48 | sub niceName() | ||||||||||||||||||
| 49 | 0 | ▶ | { my $name = shift->name; | ||||||||||||||||
|
Subroutine
niceName: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||||||||
| 50 | 0 | ▶ | $name =~ m/[a-z]/ ? $name : ucfirst(lc $name); | ||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||
| 51 | } | ||||||||||||||||||
| 52 | |||||||||||||||||||
| 53 | #------------------------------------------- | ||||||||||||||||||
| 54 | |||||||||||||||||||
| 55 | |||||||||||||||||||
| 56 | 0 | ▶ | sub path() { panic "Not implemented" } | ||||||||||||||||
|
Subroutine
path: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||
| 57 | |||||||||||||||||||
| 58 | |||||||||||||||||||
| 59 | 0 | ▶ | sub findEntry($) { panic "Not implemented" } | ||||||||||||||||
|
Subroutine
findEntry: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||
| 60 | |||||||||||||||||||
| 61 | #------------------------------------------- | ||||||||||||||||||
| 62 | |||||||||||||||||||
| 63 | |||||||||||||||||||
| 64 | sub all($@) | ||||||||||||||||||
| 65 | 0 | ▶ | { my ($self, $method) = (shift, shift); | ||||||||||||||||
|
Subroutine
all: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||
| 66 | 0 | $self->$method(@_); | |||||||||||||||||
| 67 | } | ||||||||||||||||||
| 68 | |||||||||||||||||||
| 69 | |||||||||||||||||||
| 70 | sub isEmpty() | ||||||||||||||||||
| 71 | 0 | ▶ | { my $self = shift; | ||||||||||||||||
|
Subroutine
isEmpty: not called CC=6 SCAR=37.4
Pod
documented
| |||||||||||||||||||
| 72 | |||||||||||||||||||
| 73 | 0 | my $manual = $self->manual; | |||||||||||||||||
| 74 | 0 | ▶ | return 0 if $self->description !~ m/^\s*$/; | ||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||
| 75 | 0 | ▶ | return 0 if first {!$manual->inherited($_)} | ||||||||||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||||||||||
| 76 | 0 | ▶ | $self->examples, $self->subroutines; | ||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||
| 77 | |||||||||||||||||||
| 78 | my @nested | ||||||||||||||||||
| 79 | 0 | ▶ | = $self->isa('OODoc::Text::Chapter') ? $self->sections | ||||||||||||||||
|
Branch: 3 branches
| |||||||||||||||||||
| 80 | : $self->isa('OODoc::Text::Section') ? $self->subsections | ||||||||||||||||||
| 81 | : $self->isa('OODoc::Text::SubSection') ? $self->subsubsections | ||||||||||||||||||
| 82 | : return 1; | ||||||||||||||||||
| 83 | |||||||||||||||||||
| 84 | 0 | ▶ | not first {!$_->isEmpty} @nested; | ||||||||||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||||||||||
| 85 | } | ||||||||||||||||||
| 86 | |||||||||||||||||||
| 87 | #------------------- | ||||||||||||||||||
| 88 | |||||||||||||||||||
| 89 | sub addSubroutine(@) | ||||||||||||||||||
| 90 | 0 | ▶ | { my $self = shift; | ||||||||||||||||
|
Subroutine
addSubroutine: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||||||||
| 91 | 0 | push @{$self->{OTS_subs}}, @_; | |||||||||||||||||
| 92 | 0 | $_->container($self) for @_; | |||||||||||||||||
| 93 | 0 | $self; | |||||||||||||||||
| 94 | } | ||||||||||||||||||
| 95 | |||||||||||||||||||
| 96 | |||||||||||||||||||
| 97 | 0 | ▶ | sub subroutines() { @{shift->{OTS_subs}} } | ||||||||||||||||
|
Subroutine
subroutines: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||
| 98 | |||||||||||||||||||
| 99 | |||||||||||||||||||
| 100 | sub subroutine($) | ||||||||||||||||||
| 101 | 0 | ▶ | { my ($self, $name) = @_; | ||||||||||||||||
|
Subroutine
subroutine: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||
| 102 | 0 | ▶ | first {$_->name eq $name} $self->subroutines; | ||||||||||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||||||||||
| 103 | } | ||||||||||||||||||
| 104 | |||||||||||||||||||
| 105 | |||||||||||||||||||
| 106 | sub setSubroutines($) | ||||||||||||||||||
| 107 | 0 | ▶ | { my $self = shift; | ||||||||||||||||
|
Subroutine
setSubroutines: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||||||||
| 108 | 0 | ▶ | $self->{OTS_subs} = shift || []; | ||||||||||||||||
|
Condition0%0/2
shift() || []
MC/DC0%0/1
shift() || []
shift()
Truth table0%0/2
A
A= shift()
| |||||||||||||||||||
| 109 | } | ||||||||||||||||||
| 110 | |||||||||||||||||||
| 111 | #------------------------------------------- | ||||||||||||||||||
| 112 | |||||||||||||||||||
| 113 | |||||||||||||||||||
| 114 | |||||||||||||||||||
| 115 | 1 | 1; | |||||||||||||||||