lib/OODoc/Text.pm

filter: Statementstmt 33.3% 21 / 63 Branchbran 0.0% 0 / 20 Conditioncond 0.0% 0 / 8 MC/DCmcdc 0.0% 0 / 5 Subroutinesub 26.0% 6 / 23 Podpod 91.6% 11 / 12 totaltotal 29.0% 38 / 131 CC 14 SCAR 26.1
CC
14
Cov
23%
init
42.0
description
30.0
findDescriptionObject
12.0
CRAP 13.6
« lib/OODoc/Text/SubSection.pm ↑ Summary lib/OODoc/Parser.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;
7 1 ▶use vars '$VERSION';
Subroutine BEGIN: called CC=1 SCAR=0.0
8 1 $VERSION = '2.01';
9  
10 1 ▶use base 'OODoc::Object';
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 0 ▶use overload '==' => sub {$_[0]->unique == $_[1]->unique}
Subroutine __ANON__: not called CC=1 SCAR=6.9
19 0 ▶ , '!=' => sub {$_[0]->unique != $_[1]->unique}
Subroutine __ANON__: not called CC=1 SCAR=6.9
20 0 ▶ , '""' => sub {$_[0]->name}
Subroutine __ANON__: not called CC=1 SCAR=6.9
21 0 ▶ , 'cmp' => sub {$_[0]->name cmp "$_[1]"}
Subroutine __ANON__: not called CC=1 SCAR=6.9
22 1 ▶ , 'bool' => sub {1};
Subroutine BEGIN: called CC=1 SCAR=0.2
Subroutine __ANON__: not called CC=1 SCAR=0.2
23  
24 #-------------------------------------------
25  
26  
27 1 my $unique = 1;
28  
29 sub init($)
30 0 ▶{ my ($self, $args) = @_;
Subroutine init: not called CC=6 SCAR=37.4
Pod undocumented
31 0 ▶ $self->SUPER::init($args) or return;
Branch: 1 branch
BranchTrueFalseTotal
$self->SUPER::init($args) or return 0 0 0
32  
33 0 $self->{OT_name} = delete $args->{name};
34  
35 0 ▶ my $nr = $self->{OT_linenr} = delete $args->{linenr} or panic;
Branch: 1 branch
BranchTrueFalseTotal
my $nr = $self->{"OT_linenr"} = delete $args->{"linenr"} or &panic() 0 0 0
36 0 ▶ $self->{OT_type} = delete $args->{type} or panic;
Branch: 1 branch
BranchTrueFalseTotal
$self->{"OT_type"} = delete $args->{"type"} or &panic() 0 0 0
37  
38 exists $args->{container} # may be explicit undef
39 0 ▶ or panic "no text container specified for the {pkg} object"
Branch: 1 branch
BranchTrueFalseTotal
exists $args->{"container"} or &panic("no text container specified for the {pkg} object", "pkg", ref $self) 0 0 0
40 , pkg => ref $self;
41  
42 # may be undef
43 0 $self->{OT_container}= delete $args->{container};
44
45 0 ▶ $self->{OT_descr} = delete $args->{description} || '';
Condition0%0/2
delete $args->{'description'} || ''
l!l
00
MC/DC0%0/1
delete $args->{'description'} || ''
delete $args->{'description'}
Truth table0%0/2
A
A= delete $args->{'description'}
Aresult
11
00
46 0 $self->{OT_examples} = [];
47 0 $self->{OT_unique} = $unique++;
48  
49 0 $self;
50 }
51  
52 #-------------------------------------------
53  
54  
55 0 ▶sub name() {shift->{OT_name}}
Subroutine name: not called CC=1 SCAR=6.9
Pod documented
56  
57  
58 0 ▶sub type() {shift->{OT_type}}
Subroutine type: not called CC=1 SCAR=6.9
Pod documented
59  
60  
61 sub description()
62 0 ▶{ my $text = shift->{OT_descr};
Subroutine description: not called CC=5 SCAR=34.0
Pod documented
63 0 my @lines = split /^/m, $text;
64 0 ▶ shift @lines while @lines && $lines[ 0] =~ m/^\s*$/;
Branch: 1 branch
BranchTrueFalseTotal
@lines and $lines[0] =~ /^\s*$/ and do { shift @lines } 0 0 0
Condition0%0/3
@lines and $lines[0] =~ /^\s*$/
!ll&&!rl&&r
000
MC/DC0%0/2
@lines and $lines[0] =~ /^\s*$/
@lines $lines[0] =~ /^\s*$/
Truth table0%0/3
A and B
A= @linesB= $lines[0] =~ /^\s*$/
ABresult
0X0
100
111
65 0 ▶ pop @lines while @lines && $lines[-1] =~ m/^\s*$/;
Branch: 1 branch
BranchTrueFalseTotal
@lines and $lines[-1] =~ /^\s*$/ and do { pop @lines } 0 0 0
Condition0%0/3
@lines and $lines[-1] =~ /^\s*$/
!ll&&!rl&&r
000
MC/DC0%0/2
@lines and $lines[-1] =~ /^\s*$/
@lines $lines[-1] =~ /^\s*$/
Truth table0%0/3
A and B
A= @linesB= $lines[-1] =~ /^\s*$/
ABresult
0X0
100
111
66 0 join '', @lines;
67 }
68  
69  
70 sub container(;$)
71 0 ▶{ my $self = shift;
Subroutine container: not called CC=2 SCAR=17.9
Pod documented
72 0 ▶ @_ ? ($self->{OT_container} = shift) : $self->{OT_container};
Branch: 1 branch
BranchTrueFalseTotal
@_ ? : 0 0 0
73 }
74  
75  
76 sub manual(;$)
77 0 ▶{ my $self = shift;
Subroutine manual: not called CC=2 SCAR=17.9
Pod documented
78 0 ▶ @_ ? $self->SUPER::manual(@_)
Branch: 1 branch
BranchTrueFalseTotal
@_ ? : 0 0 0
79 : $self->container->manual;
80 }
81  
82  
83 0 ▶sub unique() {shift->{OT_unique}}
Subroutine unique: not called CC=1 SCAR=6.9
Pod documented
84  
85  
86 sub where()
87 0 ▶{ my $self = shift;
Subroutine where: not called CC=1 SCAR=6.9
Pod documented
88 0 ($self->manual->source, $self->{OT_linenr});
89 }
90  
91 #-------------------------------------------
92  
93  
94 0 ▶sub openDescription() { \shift->{OT_descr} }
Subroutine openDescription: not called CC=1 SCAR=6.9
Pod documented
95  
96  
97 sub findDescriptionObject()
98 0 ▶{ my $self = shift;
Subroutine findDescriptionObject: not called CC=3 SCAR=24.8
Pod documented
99 0 ▶ return $self if length $self->description;
Branch: 1 branch
BranchTrueFalseTotal
if length $self->description 0 0 0
100  
101 0 my @descr = map { $_->findDescriptionObject } $self->extends;
102 0 ▶ wantarray ? @descr : $descr[0];
Branch: 1 branch
BranchTrueFalseTotal
wantarray ? : 0 0 0
103 }
104  
105  
106 sub example($)
107 0 ▶{ my ($self, $example) = @_;
Subroutine example: not called CC=1 SCAR=6.9
Pod documented
108 0 push @{$self->{OT_examples}}, $example;
109 0 $example;
110 }
111  
112  
113 0 ▶sub examples() { @{shift->{OT_examples}} }
Subroutine examples: not called CC=1 SCAR=6.9
Pod documented
114  
115 #-------------------------------------------
116  
117  
118 1 1;
« lib/OODoc/Text/SubSection.pm ↑ Summary lib/OODoc/Parser.pm »