Markdent/Role/DebugPrinter.pm

filter: Statementstmt 60.6% 20 / 33 Branchbran 0.0% 0 / 2 Conditioncond 25.0% 1 / 4 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 71.4% 5 / 7 Podpod n/a totaltotal 54.1% 26 / 48 CC 3 SCAR 15.6
CC
3
Cov
54%
_debug_parse_result
12.0
_print_debug
2.0
BEGIN
1.0
CRAP 4.8
« Markdent/Parser/BlockParser.pm ↑ Summary Markdent/Parser.pm »
1 package Markdent::Role::DebugPrinter;
2  
3 35 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 35 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 35 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 35 our $VERSION = '0.41';
8  
9 35 ▶use Markdent::Types;
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 35 ▶use Moose::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 has debug => (
14 is => 'rw',
15 isa => t('Bool'),
16 35 ▶ default => $ENV{MARKDENT_DEBUG} || 0,
Condition50%1/2
$ENV{'MARKDENT_DEBUG'} || 0
l!l
035
MC/DC0%0/1
$ENV{'MARKDENT_DEBUG'} || 0
$ENV{'MARKDENT_DEBUG'}
Truth table50%1/2
A
A= $ENV{'MARKDENT_DEBUG'}
Aresult
11
00
17 );
18  
19 35 my $HR1 = q{=} x 70;
20 35 my $HR2 = q{-} x 70;
21  
22 ## no critic (Subroutines::ProhibitUnusedPrivateSubroutines)
23 0 ▶sub _debug_parse_result {
Subroutine _debug_parse_result: not called CC=3 SCAR=24.8
24 0 my $self = shift;
25 0 my $text = shift;
26 0 my $type = shift;
27 0 ▶ my $extra = shift || [];
Condition0%0/2
shift() || []
l!l
00
MC/DC0%0/1
shift() || []
shift()
Truth table0%0/2
A
A= shift()
Aresult
11
00
28  
29 0 my $msg = '[' . $text . "]\n" . $HR2 . "\n" . ' - ' . $type . "\n";
30 0 ▶ while ( @{$extra} ) {
Branch: 1 branch
BranchTrueFalseTotal
if (@{$extra;}) 0 0 0
31 0 my ( $key, $value ) = splice @{$extra}, 0, 2;
32 0 $msg .= sprintf( ' - %-10s : %s', $key, $value );
33 0 $msg .= "\n";
34 }
35  
36 0 $self->_print_debug($msg);
37 }
38 ## use critic
39  
40 0 ▶sub _print_debug {
Subroutine _print_debug: not called CC=1 SCAR=6.9
41 0 warn $HR1 . "\n" . ( ref $_[0] ) . "\n" . $_[1] . "\n";
42 }
43  
44 35 1;
45  
46 # ABSTRACT: A role for classes which output debugging information
47  
48 __END__
« Markdent/Parser/BlockParser.pm ↑ Summary Markdent/Parser.pm »