| 1 | package MKDoc::Text::Structured::Block; | ||||||||||||||||||||||||||||||||||||||||||
| 2 | 20 | ▶ | use MKDoc::Text::Structured::P; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 3 | 20 | ▶ | use MKDoc::Text::Structured::H1; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 4 | 20 | ▶ | use MKDoc::Text::Structured::H2; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 5 | 20 | ▶ | use MKDoc::Text::Structured::H3; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 6 | 20 | ▶ | use base qw /MKDoc::Text::Structured::Base/; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 7 | 20 | ▶ | use warnings; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 8 | 20 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 9 | |||||||||||||||||||||||||||||||||||||||||||
| 10 | |||||||||||||||||||||||||||||||||||||||||||
| 11 | sub new | ||||||||||||||||||||||||||||||||||||||||||
| 12 | 247 | ▶ | { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
new: called CC=2 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 13 | 247 | my $class = shift; | |||||||||||||||||||||||||||||||||||||||||
| 14 | 247 | my $line = shift; | |||||||||||||||||||||||||||||||||||||||||
| 15 | 247 | ▶ | return if ($line =~ /^\s*$/); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 16 | 205 | return bless {}, $class; | |||||||||||||||||||||||||||||||||||||||||
| 17 | } | ||||||||||||||||||||||||||||||||||||||||||
| 18 | |||||||||||||||||||||||||||||||||||||||||||
| 19 | |||||||||||||||||||||||||||||||||||||||||||
| 20 | sub is_ok | ||||||||||||||||||||||||||||||||||||||||||
| 21 | 132 | ▶ | { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
is_ok: called CC=3 SCAR=11.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 22 | 132 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 23 | 132 | my $line = shift; | |||||||||||||||||||||||||||||||||||||||||
| 24 | 132 | ▶ | my $obj = MKDoc::Text::Structured::Factory->new ($line) || return; | ||||||||||||||||||||||||||||||||||||||||
|
Condition100%2/2
'MKDoc::Text::Structured::Factory'->new($line) || (return)
MC/DC100%1/1
'MKDoc::Text::Structured::Factory'->new($line) || (return)
'MKDoc::Text::Structured::Factory'->new($line)
Truth table100%2/2
A
A= 'MKDoc::Text::Structured::Factory'->new($line)
| |||||||||||||||||||||||||||||||||||||||||||
| 25 | 114 | ▶ | return 1 if (ref $obj eq ref $self); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 26 | 2 | return; | |||||||||||||||||||||||||||||||||||||||||
| 27 | } | ||||||||||||||||||||||||||||||||||||||||||
| 28 | |||||||||||||||||||||||||||||||||||||||||||
| 29 | |||||||||||||||||||||||||||||||||||||||||||
| 30 | sub process | ||||||||||||||||||||||||||||||||||||||||||
| 31 | 93 | ▶ | { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
process: called CC=8 SCAR=20.8
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 32 | 93 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 33 | 93 | my @lines = @{$self->{lines}}; | |||||||||||||||||||||||||||||||||||||||||
| 34 | |||||||||||||||||||||||||||||||||||||||||||
| 35 | # ========= | ||||||||||||||||||||||||||||||||||||||||||
| 36 | # Heading 1 | ||||||||||||||||||||||||||||||||||||||||||
| 37 | # ========= | ||||||||||||||||||||||||||||||||||||||||||
| 38 | @lines > 1 and | ||||||||||||||||||||||||||||||||||||||||||
| 39 | $lines[0] =~ /^==/ and | ||||||||||||||||||||||||||||||||||||||||||
| 40 | 93 | ▶ | $lines[-1] =~ /^==/ and do { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition83%5/6
@lines > 1 and $lines[0] =~ /^==/ and $lines[-1] =~ /^==/
@lines > 1 and $lines[0] =~ /^==/
MC/DC66%2/3
@lines > 1 and $lines[0] =~ /^==/ and $lines[-1] =~ /^==/
@lines > 1
$lines[0] =~ /^==/
$lines[-1] =~ /^==/
Truth table75%3/4
A and B and C
A= @lines > 1B= $lines[0] =~ /^==/C= $lines[-1] =~ /^==/
| |||||||||||||||||||||||||||||||||||||||||||
| 41 | 1 | shift (@lines); | |||||||||||||||||||||||||||||||||||||||||
| 42 | 1 | pop (@lines); | |||||||||||||||||||||||||||||||||||||||||
| 43 | 1 | $self->{lines} = \@lines; | |||||||||||||||||||||||||||||||||||||||||
| 44 | 1 | bless $self, 'MKDoc::Text::Structured::H1'; | |||||||||||||||||||||||||||||||||||||||||
| 45 | 1 | return $self->process (@_); | |||||||||||||||||||||||||||||||||||||||||
| 46 | }; | ||||||||||||||||||||||||||||||||||||||||||
| 47 | |||||||||||||||||||||||||||||||||||||||||||
| 48 | # Heading 2 | ||||||||||||||||||||||||||||||||||||||||||
| 49 | # ========= | ||||||||||||||||||||||||||||||||||||||||||
| 50 | @lines > 1 and | ||||||||||||||||||||||||||||||||||||||||||
| 51 | 92 | ▶ | $lines[-1] =~ /^==/ and do { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
@lines > 1 and $lines[-1] =~ /^==/
MC/DC100%2/2
@lines > 1 and $lines[-1] =~ /^==/
@lines > 1
$lines[-1] =~ /^==/
Truth table100%3/3
A and B
A= @lines > 1B= $lines[-1] =~ /^==/
| |||||||||||||||||||||||||||||||||||||||||||
| 52 | 5 | pop (@lines); | |||||||||||||||||||||||||||||||||||||||||
| 53 | 5 | $self->{lines} = \@lines; | |||||||||||||||||||||||||||||||||||||||||
| 54 | 5 | bless $self, 'MKDoc::Text::Structured::H2'; | |||||||||||||||||||||||||||||||||||||||||
| 55 | 5 | return $self->process (@_); | |||||||||||||||||||||||||||||||||||||||||
| 56 | }; | ||||||||||||||||||||||||||||||||||||||||||
| 57 | |||||||||||||||||||||||||||||||||||||||||||
| 58 | # Heading 3 | ||||||||||||||||||||||||||||||||||||||||||
| 59 | # --------- | ||||||||||||||||||||||||||||||||||||||||||
| 60 | @lines > 1 and | ||||||||||||||||||||||||||||||||||||||||||
| 61 | 87 | ▶ | $lines[-1] =~ /^--/ and do { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
@lines > 1 and $lines[-1] =~ /^--/
MC/DC100%2/2
@lines > 1 and $lines[-1] =~ /^--/
@lines > 1
$lines[-1] =~ /^--/
Truth table100%3/3
A and B
A= @lines > 1B= $lines[-1] =~ /^--/
| |||||||||||||||||||||||||||||||||||||||||||
| 62 | 3 | pop (@lines); | |||||||||||||||||||||||||||||||||||||||||
| 63 | 3 | $self->{lines} = \@lines; | |||||||||||||||||||||||||||||||||||||||||
| 64 | 3 | bless $self, 'MKDoc::Text::Structured::H3'; | |||||||||||||||||||||||||||||||||||||||||
| 65 | 3 | return $self->process (@_); | |||||||||||||||||||||||||||||||||||||||||
| 66 | }; | ||||||||||||||||||||||||||||||||||||||||||
| 67 | |||||||||||||||||||||||||||||||||||||||||||
| 68 | # normal, boring paragraph | ||||||||||||||||||||||||||||||||||||||||||
| 69 | 84 | bless $self, 'MKDoc::Text::Structured::P'; | |||||||||||||||||||||||||||||||||||||||||
| 70 | 84 | return $self->process (@_); | |||||||||||||||||||||||||||||||||||||||||
| 71 | } | ||||||||||||||||||||||||||||||||||||||||||
| 72 | |||||||||||||||||||||||||||||||||||||||||||
| 73 | |||||||||||||||||||||||||||||||||||||||||||
| 74 | 20 | 1; | |||||||||||||||||||||||||||||||||||||||||
| 75 | |||||||||||||||||||||||||||||||||||||||||||
| 76 | __END__ | ||||||||||||||||||||||||||||||||||||||||||