blib/lib/CPAN/Debug.pm

filter: Statementstmt 36.7% 25 / 68 Branchbran 25.0% 8 / 32 Conditioncond 12.5% 1 / 8 MC/DCmcdc 0.0% 0 / 5 Subroutinesub 75.0% 3 / 4 Podpod 0.0% 0 / 2 totaltotal 31.0% 37 / 119 CC 23 SCAR 42.4
CC
23
Cov
31%
debug
75.3
debug
75.3
BEGIN
1.0
CRAP 69.6
« blib/lib/CPAN/CacheMgr.pm ↑ Summary blib/lib/CPAN/Version.pm »
1 # -*- Mode: cperl; coding: utf-8; cperl-indent-level: 4 -*-
2 package CPAN::Debug;
3 26 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 26 ▶use vars qw($VERSION);
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 26 $VERSION = "5.5002";
7 # module is internal to CPAN.pm
8  
9 26 %CPAN::DEBUG = qw[
10 CPAN 1
11 Index 2
12 InfoObj 4
13 Author 8
14 Distribution 16
15 Bundle 32
16 Module 64
17 CacheMgr 128
18 Complete 256
19 FTP 512
20 Shell 1024
21 Eval 2048
22 HandleConfig 4096
23 Tarzip 8192
24 Version 16384
25 Queue 32768
26 FirstTime 65536
27 ];
28  
29 26 ▶$CPAN::DEBUG ||= 0;
Condition50%1/2
$CPAN::DEBUG ||= 0
l!l
026
MC/DC0%0/1
$CPAN::DEBUG ||= 0
$CPAN::DEBUG
Truth table50%1/2
A
A= $CPAN::DEBUG
Aresult
11
00
30  
31 #-> sub CPAN::Debug::debug ;
32 75 ▶sub debug {
Subroutine debug: called CC=12 SCAR=43.2
Pod undocumented
33 0 ▶ my($self,$arg) = @_;
Subroutine debug: not called CC=12 SCAR=43.2
Pod undocumented
34  
35 0 my @caller;
36 0 my $i = 0;
37 0 while () {
38 0 ▶ my(@c) = (caller($i))[0 .. ($i ? 3 : 2)];
Branch: 2 branches
BranchTrueFalseTotal
$i ? : 150 75 225
$i ? : 0 0 0
39 0 ▶ last unless defined $c[0];
Branch: 2 branches
BranchTrueFalseTotal
unless defined $c[0] 0 225 225
unless defined $c[0] 0 0 0
40 0 push @caller, \@c;
41 0 for (0,3) {
42 0 ▶ last if $_ > $#c;
Branch: 2 branches
BranchTrueFalseTotal
if $_ > $#c 75 375 450
if $_ > $#c 0 0 0
43 0 $c[$_] =~ s/.*:://;
44 }
45 0 for (1) {
46 0 $c[$_] =~ s|.*/||;
47 }
48 0 ▶ last if ++$i>=3;
Branch: 2 branches
BranchTrueFalseTotal
if ++$i >= 3 75 150 225
if ++$i >= 3 0 0 0
49 }
50 0 pop @caller;
51 0 ▶ if ($CPAN::DEBUG{$caller[0][0]} & $CPAN::DEBUG) {
Branch: 2 branches
BranchTrueFalseTotal
if ($CPAN::DEBUG{$caller[0][0]} & $CPAN::DEBUG) 0 75 75
if ($CPAN::DEBUG{$caller[0][0]} & $CPAN::DEBUG) 0 0 0
52 0 ▶ if ($arg and ref $arg) {
Branch: 2 branches
BranchTrueFalseTotal
if ($arg and ref $arg) { } 0 0 0
if ($arg and ref $arg) { } 0 0 0
Condition0%0/6
$arg and ref $arg
!ll&&!rl&&r
000
$arg and ref $arg
!ll&&!rl&&r
000
MC/DC0%0/2
$arg and ref $arg
$arg ref $arg
MC/DC0%0/2
$arg and ref $arg
$arg ref $arg
Truth table0%0/3
A and B
A= $argB= ref $arg
ABresult
0X0
100
111
Truth table0%0/3
A and B
A= $argB= ref $arg
ABresult
0X0
100
111
53 0 eval { require Data::Dumper };
54 0 ▶ if ($@) {
Branch: 2 branches
BranchTrueFalseTotal
if ($@) { } 0 0 0
if ($@) { } 0 0 0
55 0 $CPAN::Frontend->myprint("Debug(\n" . $arg->as_string . ")\n");
56 } else {
57 0 local $Data::Dumper::Sortkeys = 1;
58 0 $CPAN::Frontend->myprint("Debug(\n" . Data::Dumper::Dumper($arg) . ")\n");
59 }
60 } else {
61 0 my $outer = "";
62 0 local $" = ",";
63 0 ▶ if (@caller>1) {
Branch: 2 branches
BranchTrueFalseTotal
if (@caller > 1) 0 0 0
if (@caller > 1) 0 0 0
64 0 $outer = ",[@{$caller[1]}]";
65 }
66 0 $CPAN::Frontend->myprint("Debug(@{$caller[0]}$outer): $arg\n");
67 }
68 }
69 }
70  
71 26 1;
72  
73 __END__
« blib/lib/CPAN/CacheMgr.pm ↑ Summary blib/lib/CPAN/Version.pm »