PAD/Plugin/Markdown.pm

filter: Statementstmt 56.5% 13 / 23 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 57.1% 4 / 7 Podpod 100% 3 / 3 totaltotal 57.1% 20 / 35 CC 2 SCAR 9.2
CC
2
Cov
52%
execute
6.0
suffix
2.0
content_type
2.0
CRAP 2.5
« PAD/Plugin.pm ↑ Summary PAD/Plugin/Static.pm »
1 package PAD::Plugin::Markdown;
2 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 ▶use parent 'PAD::Plugin';
Subroutine BEGIN: called CC=1 SCAR=0.0
5 2 ▶use Text::Markdown 'markdown';
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 0 ▶sub suffix { qr/\.(?:markdown|mk?dn?)$/ }
Subroutine suffix: not called CC=1 SCAR=6.9
Pod documented
8 0 ▶sub content_type { 'text/html; charset=UTF-8' }
Subroutine content_type: not called CC=1 SCAR=6.9
Pod documented
9  
10 0 ▶sub execute {
Subroutine execute: not called CC=2 SCAR=17.9
Pod documented
11 0 my $self = shift;
12 0 my $path = $self->relative_path;
13  
14 0 ▶ open my $text, '<', $path or die $!;
Branch: 1 branch
BranchTrueFalseTotal
open my $text, "<", $path or die $! 0 0 0
15 0 my $md = markdown(do { local $/; <$text> });
16  
17 0 my $res = $self->request->new_response(200, ['Content-Type' => $self->content_type], $md);
18 0 $res->finalize;
19 }
20  
21 2 1;
22 __END__
« PAD/Plugin.pm ↑ Summary PAD/Plugin/Static.pm »