| 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
MC/DC0%0/1
$ENV{'MARKDENT_DEBUG'} || 0
$ENV{'MARKDENT_DEBUG'}
Truth table50%1/2
A
A= $ENV{'MARKDENT_DEBUG'}
| |||||||||||||
| 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() || []
MC/DC0%0/1
shift() || []
shift()
Truth table0%0/2
A
A= shift()
| |||||||||||||
| 28 | |||||||||||||
| 29 | 0 | my $msg = '[' . $text . "]\n" . $HR2 . "\n" . ' - ' . $type . "\n"; | |||||||||||
| 30 | 0 | ▶ | while ( @{$extra} ) { | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 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__ | ||||||||||||