lib/OODoc/Text/SubSection.pm

filter: Statementstmt 36.7% 18 / 49 Branchbran 0.0% 0 / 10 Conditioncond 0.0% 0 / 7 MC/DCmcdc 0.0% 0 / 4 Subroutinesub 38.4% 5 / 13 Podpod 87.5% 7 / 8 totaltotal 32.9% 30 / 91 CC 10 SCAR 26.9
CC
10
Cov
27%
init
42.0
subsubsections
12.0
findEntry
6.0
CRAP 14.8
« lib/OODoc/Text/Section.pm ↑ Summary lib/OODoc/Text.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::SubSection;
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  
17  
18 sub init($)
19 0 ▶{ my ($self, $args) = @_;
Subroutine init: not called CC=6 SCAR=37.4
Pod undocumented
20 0 ▶ $args->{type} ||= 'Subsection';
Condition0%0/2
$args->{"type"} ||= "Subsection"
l!l
00
MC/DC0%0/1
$args->{"type"} ||= "Subsection"
$args->{"type"}
Truth table0%0/2
A
A= $args->{"type"}
Aresult
11
00
21 0 ▶ $args->{container} ||= delete $args->{section} or panic;
Branch: 1 branch
BranchTrueFalseTotal
$args->{"container"} ||= delete $args->{"section"} or &panic() 0 0 0
Condition0%0/3
$args->{"container"} ||= delete $args->{"section"}
l!l&&r!l&&!r
000
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"}
ABresult
1X1
011
000
22 0 ▶ $args->{level} ||= 3;
Condition0%0/2
$args->{"level"} ||= 3
l!l
00
MC/DC0%0/1
$args->{"level"} ||= 3
$args->{"level"}
Truth table0%0/2
A
A= $args->{"level"}
Aresult
11
00
23  
24 0 ▶ $self->SUPER::init($args) or return;
Branch: 1 branch
BranchTrueFalseTotal
$self->SUPER::init($args) or return 0 0 0
25 0 $self->{OTS_subsubsections} = [];
26 0 $self;
27 }
28  
29 sub emptyExtension($)
30 0 ▶{ my ($self, $container) = @_;
Subroutine emptyExtension: not called CC=1 SCAR=6.9
Pod documented
31 0 my $empty = $self->SUPER::emptyExtension($container);
32 0 my @subsub = map $_->emptyExtension($empty), $self->subsubsections;
33 0 $empty->subsubsections(@subsub);
34 0 $empty;
35 }
36  
37 sub findEntry($)
38 0 ▶{ my ($self, $name) = @_;
Subroutine findEntry: not called CC=2 SCAR=17.9
Pod documented
39 0 ▶ $self->name eq $name ? $self : ();
Branch: 1 branch
BranchTrueFalseTotal
$self->name eq $name ? : 0 0 0
40 }
41  
42 #-------------------------------------------
43  
44  
45 0 ▶sub section() { shift->container }
Subroutine section: not called CC=1 SCAR=6.9
Pod documented
46  
47  
48 0 ▶sub chapter() { shift->section->chapter }
Subroutine chapter: not called CC=1 SCAR=6.9
Pod documented
49  
50 sub path()
51 0 ▶{ my $self = shift;
Subroutine path: not called CC=1 SCAR=6.9
Pod documented
52 0 $self->section->path . '/' . $self->name;
53 }
54  
55 #-------------------------------------------
56  
57  
58 sub subsubsection($)
59 0 ▶{ my ($self, $thing) = @_;
Subroutine subsubsection: not called CC=2 SCAR=17.9
Pod documented
60  
61 0 ▶ if(ref $thing)
Branch: 1 branch
BranchTrueFalseTotal
if (ref $thing) 0 0 0
62 0 { push @{$self->{OTS_subsubsections}}, $thing;
63 0 return $thing;
64 }
65  
66 0 first {$_->name eq $thing} $self->subsubsections;
67 }
68  
69  
70 sub subsubsections(;@)
71 0 ▶{ my $self = shift;
Subroutine subsubsections: not called CC=3 SCAR=24.8
Pod documented
72 0 ▶ if(@_)
Branch: 1 branch
BranchTrueFalseTotal
if (@_) 0 0 0
73 0 { $self->{OTS_subsubsections} = [ @_ ];
74 0 $_->container($self) for @_;
75 }
76  
77 0 @{$self->{OTS_subsubsections}};
78 }
79  
80  
81 1 1;
82  
83 1 1;
« lib/OODoc/Text/Section.pm ↑ Summary lib/OODoc/Text.pm »