lib/OODoc/Text/Structure.pm

filter: Statementstmt 35.7% 20 / 56 Branchbran 0.0% 0 / 16 Conditioncond 0.0% 0 / 2 MC/DCmcdc 0.0% 0 / 1 Subroutinesub 28.5% 6 / 21 Podpod 91.6% 11 / 12 totaltotal 34.2% 37 / 108 SCAR 40.6
CC
11
Cov
27%
isEmpty
42.0
init
12.0
niceName
6.0
CRAP 58.0
« lib/OODoc/Object.pm ↑ Summary blib/lib/OODoc/Manifest.pm »
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::Structure;
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';
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 1 ▶use List::Util 'first';
Subroutine BEGIN: called CC=1 SCAR=0.0
19  
20  
21 sub init($)
22 0 ▶{ my ($self, $args) = @_;
Subroutine init: not called CC=3 SCAR=24.8
Pod undocumented
23 0 ▶ $self->SUPER::init($args) or return;
Branch: 1 branch
BranchTrueFalseTotal
$self->SUPER::init($args) or return 0 0 0
24 0 $self->{OTS_subs} = [];
25 $self->{OTS_level} = delete $args->{level}
26 0 ▶ or panic "no level defined for structural component";
Branch: 1 branch
BranchTrueFalseTotal
$self->{"OTS_level"} = delete $args->{"level"} or &panic("no level defined for structural component") 0 0 0
27 0 $self;
28 }
29  
30  
31 sub emptyExtension($)
32 0 ▶{ my ($self, $container) = @_;
Subroutine emptyExtension: not called CC=1 SCAR=6.9
Pod documented
33  
34 0 my $new = ref($self)->new
35 ( name => $self->name
36 , linenr => -1
37 , level => $self->level
38 , container => $container
39 );
40 0 $new->extends($self);
41 0 $new;
42 }
43  
44 #-------------------------------------------
45  
46  
47 0 ▶sub level() {shift->{OTS_level}}
Subroutine level: not called CC=1 SCAR=6.9
Pod documented
48  
49  
50 sub niceName()
51 0 ▶{ my $name = shift->name;
Subroutine niceName: not called CC=2 SCAR=17.9
Pod documented
52 0 ▶ $name =~ m/[a-z]/ ? $name : ucfirst(lc $name);
Branch: 1 branch
BranchTrueFalseTotal
$name =~ /[a-z]/ ? : 0 0 0
53 }
54  
55 #-------------------------------------------
56  
57  
58 0 ▶sub path() { panic "Not implemented" }
Subroutine path: not called CC=1 SCAR=6.9
Pod documented
59  
60  
61 0 ▶sub findEntry($) { panic "Not implemented" }
Subroutine findEntry: not called CC=1 SCAR=6.9
Pod documented
62  
63 #-------------------------------------------
64  
65  
66 sub all($@)
67 0 ▶{ my ($self, $method) = (shift, shift);
Subroutine all: not called CC=1 SCAR=6.9
Pod documented
68 0 $self->$method(@_);
69 }
70  
71  
72 sub isEmpty()
73 0 ▶{ my $self = shift;
Subroutine isEmpty: not called CC=6 SCAR=37.4
Pod documented
74  
75 0 my $manual = $self->manual;
76 0 ▶ return 0 if $self->description !~ m/^\s*$/;
Branch: 1 branch
BranchTrueFalseTotal
unless $self->description =~ /^\s*$/ 0 0 0
77 0 ▶ return 0 if first {!$manual->inherited($_)}
Subroutine __ANON__: not called CC=1 SCAR=6.9
78 0 ▶ $self->examples, $self->subroutines;
Branch: 1 branch
BranchTrueFalseTotal
if &first(sub { not $manual->inherited($_); } , $self->examples, $self->subroutines) 0 0 0
79  
80 my @nested
81 0 ▶ = $self->isa('OODoc::Text::Chapter') ? $self->sections
Branch: 3 branches
BranchTrueFalseTotal
$self->isa('OODoc::Text::Chapter') ? : 0 0 0
$self->isa('OODoc::Text::Section') ? : 0 0 0
$self->isa('OODoc::Text::SubSection') ? : 0 0 0
82 : $self->isa('OODoc::Text::Section') ? $self->subsections
83 : $self->isa('OODoc::Text::SubSection') ? $self->subsubsections
84 : return 1;
85  
86 0 ▶ not first {!$_->isEmpty} @nested;
Subroutine __ANON__: not called CC=1 SCAR=6.9
87 }
88  
89 #-------------------
90  
91 sub addSubroutine(@)
92 0 ▶{ my $self = shift;
Subroutine addSubroutine: not called CC=2 SCAR=17.9
Pod documented
93 0 push @{$self->{OTS_subs}}, @_;
94 0 $_->container($self) for @_;
95 0 $self;
96 }
97  
98  
99 0 ▶sub subroutines() { @{shift->{OTS_subs}} }
Subroutine subroutines: not called CC=1 SCAR=6.9
Pod documented
100  
101  
102 sub subroutine($)
103 0 ▶{ my ($self, $name) = @_;
Subroutine subroutine: not called CC=1 SCAR=6.9
Pod documented
104 0 ▶ first {$_->name eq $name} $self->subroutines;
Subroutine __ANON__: not called CC=1 SCAR=6.9
105 }
106  
107  
108 sub setSubroutines($)
109 0 ▶{ my $self = shift;
Subroutine setSubroutines: not called CC=2 SCAR=17.9
Pod documented
110 0 ▶ $self->{OTS_subs} = shift || [];
Condition0%0/2
shift() || []
l!l
00
MC/DC0%0/1
shift() || []
shift()
Truth table0%0/2
A
A= shift()
Aresult
11
00
111 }
112  
113 #-------------------------------------------
114  
115  
116  
117 1 1;
« lib/OODoc/Object.pm ↑ Summary blib/lib/OODoc/Manifest.pm »