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 CC 11 SCAR 24.2
CC
11
Cov
27%
isEmpty
42.0
init
12.0
niceName
6.0
CRAP 11.3
« blib/lib/OODoc/Text/Structure.pm ↑ Summary lib/OODoc/Object.pm »
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
BranchTrueFalseTotal
$self->SUPER::init($args) or return 0 0 0
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
BranchTrueFalseTotal
$self->{"OTS_level"} = delete $args->{"level"} or &panic("no level defined for structural component") 0 0 0
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
BranchTrueFalseTotal
$name =~ /[a-z]/ ? : 0 0 0
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
BranchTrueFalseTotal
unless $self->description =~ /^\s*$/ 0 0 0
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
BranchTrueFalseTotal
if &first(sub { not $manual->inherited($_); } , $self->examples, $self->subroutines) 0 0 0
77  
78 my @nested
79 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
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() || []
l!l
00
MC/DC0%0/1
shift() || []
shift()
Truth table0%0/2
A
A= shift()
Aresult
11
00
109 }
110  
111 #-------------------------------------------
112  
113  
114  
115 1 1;
« blib/lib/OODoc/Text/Structure.pm ↑ Summary lib/OODoc/Object.pm »