lib/OODoc/Text/Chapter.pm

filter: Statementstmt 31.7% 20 / 63 Branchbran 0.0% 0 / 16 Conditioncond 0.0% 0 / 7 MC/DCmcdc 0.0% 0 / 4 Subroutinesub 37.5% 6 / 16 Podpod 77.7% 7 / 9 totaltotal 28.7% 33 / 115 CC 15 SCAR 27.6
CC
15
Cov
23%
init
42.0
findSubroutine
20.0
findEntry
20.0
CRAP 15.9
« lib/OODoc/Format/Pod3.pm ↑ Summary lib/OODoc/Text/Section.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::Chapter;
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::Structure';
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=6 SCAR=37.4
Pod undocumented
21 0 ▶ $args->{type} ||= 'Chapter';
Condition0%0/2
$args->{"type"} ||= "Chapter"
l!l
00
MC/DC0%0/1
$args->{"type"} ||= "Chapter"
$args->{"type"}
Truth table0%0/2
A
A= $args->{"type"}
Aresult
11
00
22 0 ▶ $args->{container} ||= delete $args->{manual} or panic;
Branch: 1 branch
BranchTrueFalseTotal
$args->{"container"} ||= delete $args->{"manual"} or &panic() 0 0 0
Condition0%0/3
$args->{"container"} ||= delete $args->{"manual"}
l!l&&r!l&&!r
000
MC/DC0%0/2
$args->{"container"} ||= delete $args->{"manual"}
$args->{"container"} delete $args->{"manual"}
Truth table0%0/3
A ||= B
A= $args->{"container"}B= delete $args->{"manual"}
ABresult
1X1
011
000
23 0 ▶ $args->{level} ||= 1;
Condition0%0/2
$args->{"level"} ||= 1
l!l
00
MC/DC0%0/1
$args->{"level"} ||= 1
$args->{"level"}
Truth table0%0/2
A
A= $args->{"level"}
Aresult
11
00
24  
25 0 ▶ $self->SUPER::init($args)
Branch: 1 branch
BranchTrueFalseTotal
$self->SUPER::init($args) or return 0 0 0
26 or return;
27  
28 0 $self->{OTC_sections} = [];
29  
30 0 $self;
31 }
32  
33 sub emptyExtension($)
34 0 ▶{ my ($self, $container) = @_;
Subroutine emptyExtension: not called CC=1 SCAR=6.9
Pod documented
35 0 my $empty = $self->SUPER::emptyExtension($container);
36 0 my @sections = map $_->emptyExtension($empty), $self->sections;
37 0 $empty->sections(@sections);
38 0 $empty;
39 }
40  
41 0 ▶sub manual() {shift->container}
Subroutine manual: not called CC=1 SCAR=6.9
Pod documented
42 0 ▶sub path() {shift->name}
Subroutine path: not called CC=1 SCAR=6.9
Pod documented
43  
44 sub findSubroutine($)
45 0 ▶{ my ($self, $name) = @_;
Subroutine findSubroutine: not called CC=4 SCAR=30.0
Pod undocumented
46 0 my $sub = $self->SUPER::findSubroutine($name);
47 0 ▶ return $sub if defined $sub;
Branch: 1 branch
BranchTrueFalseTotal
if defined $sub 0 0 0
48  
49 0 foreach my $section ($self->sections)
50 0 { my $sub = $section->findSubroutine($name);
51 0 ▶ return $sub if defined $sub;
Branch: 1 branch
BranchTrueFalseTotal
if defined $sub 0 0 0
52 }
53  
54 0 undef;
55 }
56  
57 sub findEntry($)
58 0 ▶{ my ($self, $name) = @_;
Subroutine findEntry: not called CC=4 SCAR=30.0
Pod documented
59 0 ▶ return $self if $self->name eq $name;
Branch: 1 branch
BranchTrueFalseTotal
if $self->name eq $name 0 0 0
60  
61 0 foreach my $section ($self->sections)
62 0 { my $entry = $section->findEntry($name);
63 0 ▶ return $entry if defined $entry;
Branch: 1 branch
BranchTrueFalseTotal
if defined $entry 0 0 0
64 }
65  
66 0 ();
67 }
68  
69 sub all($@)
70 0 ▶{ my $self = shift;
Subroutine all: not called CC=1 SCAR=6.9
Pod documented
71 0 ($self->SUPER::all(@_), map {$_->all(@_)} $self->sections);
72 }
73  
74  
75 sub section($)
76 0 ▶{ my ($self, $thing) = @_;
Subroutine section: not called CC=2 SCAR=17.9
Pod documented
77  
78 0 ▶ if(ref $thing)
Branch: 1 branch
BranchTrueFalseTotal
if (ref $thing) 0 0 0
79 0 { push @{$self->{OTC_sections}}, $thing;
80 0 return $thing;
81 }
82  
83 0 ▶ first {$_->name eq $thing} $self->sections;
Subroutine __ANON__: not called CC=1 SCAR=6.9
84 }
85  
86  
87 sub sections()
88 0 ▶{ my $self = shift;
Subroutine sections: not called CC=3 SCAR=24.8
Pod documented
89 0 ▶ if(@_)
Branch: 1 branch
BranchTrueFalseTotal
if (@_) 0 0 0
90 0 { $self->{OTC_sections} = [ @_ ];
91 0 $_->container($self) for @_;
92 }
93 0 @{$self->{OTC_sections}};
94 }
95  
96 1 1;
« lib/OODoc/Format/Pod3.pm ↑ Summary lib/OODoc/Text/Section.pm »