MaxMind/DB/Role/Debugs.pm

filter: Statementstmt 37.7% 17 / 45 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 45.4% 5 / 11 Podpod n/a totaltotal 36.6% 22 / 60 CC 3 SCAR 10.5
CC
3
Cov
35%
_debug_binary
6.0
_debug_string
6.0
_debug_newline
2.0
CRAP 2.8
↑ Summary MaxMind/DB/Metadata.pm »
1 package MaxMind::DB::Role::Debugs;
2  
3 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 2 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 2 ▶use autodie;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 2 our $VERSION = '0.040001';
9  
10 2 ▶use Moo::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12 0 ▶sub _debug_newline {
Subroutine _debug_newline: not called CC=1 SCAR=6.9
13 0 warn "\n";
14 }
15  
16 0 ▶sub _debug_binary {
Subroutine _debug_binary: not called CC=2 SCAR=17.9
17 0 my $self = shift;
18 0 my $label = shift;
19 0 my $binary = shift;
20  
21 0 my $msg = "$label: ";
22  
23 0 ▶ if ( defined $binary ) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $binary) { } 0 0 0
24 0 $msg .= join q{ }, map { sprintf( '%08b', ord($_) ) } split //,
25 $binary;
26 }
27 else {
28 0 $msg .= '<undef>';
29 }
30  
31 0 warn "$msg\n";
32 }
33  
34 0 ▶sub _debug_string {
Subroutine _debug_string: not called CC=2 SCAR=17.9
35 0 my $self = shift;
36 0 my $label = shift;
37 0 my $string = shift;
38  
39 0 ▶ $string = '<undef>'
Branch: 1 branch
BranchTrueFalseTotal
unless defined $string 0 0 0
40 unless defined $string;
41  
42 0 warn "$label: $string\n";
43 }
44  
45 0 ▶sub _debug_sprintf {
Subroutine _debug_sprintf: not called CC=1 SCAR=6.9
46 0 my $self = shift;
47  
48 0 warn sprintf( shift() . "\n", @_ );
49 }
50  
51 0 ▶sub _debug_structure {
Subroutine _debug_structure: not called CC=1 SCAR=6.9
52 0 my $self = shift;
53 0 my $label = shift;
54 0 my $structure = shift;
55  
56 0 require Data::Dumper::Concise;
57 0 warn "$label: \n";
58 0 my $dumped = Data::Dumper::Concise::Dumper($structure);
59  
60 0 $dumped =~ s/^/ /mg;
61  
62 0 warn $dumped;
63 }
64  
65 0 ▶sub _debug_message {
Subroutine _debug_message: not called CC=1 SCAR=6.9
66 0 my $self = shift;
67 0 my $msg = shift;
68  
69 0 warn "$msg\n";
70 }
71  
72 2 1;
↑ Summary MaxMind/DB/Metadata.pm »