File/Utility.pm

filter: Statementstmt 47.8% 11 / 23 Branchbran 0.0% 0 / 6 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 50.0% 3 / 6 Podpod 100% 1 / 1 totaltotal 36.5% 15 / 41 CC 5 SCAR 18.4
CC
5
Cov
34%
_verbose
12.0
new
6.0
_debug
6.0
CRAP 6.3
« File/State/TempFile.pm ↑ Summary File/Source/FlatFile.pm »
1 package Iterator::File::Utility;
2  
3 ## $Id: Utility.pm,v 1.4 2008/06/11 05:20:07 wdr1 Exp $
4  
5 7 ▶use 5.006;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 7 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 7 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 7 our $VERSION = substr(q$Revision: 1.4 $, 10);
10  
11 7 our %default_config =
12 (
13 'verbose' => 0,
14 'debug' => 0,
15 );
16  
17 0 ▶sub new {
Subroutine new: not called CC=2 SCAR=17.9
Pod documented
18 0 my ($class, %config) = @_;
19  
20 0 %config = (%config, %default_config);
21 0 ▶ if ($ENV{'ITERATOR_FILE_DEBUG'}) {
Branch: 1 branch
BranchTrueFalseTotal
if ($ENV{"ITERATOR_FILE_DEBUG"}) 0 0 0
22 0 $config{'debug'} = $ENV{'ITERATOR_FILE_DEBUG'};
23 }
24  
25 0 my $self = bless(\%config, $class);
26
27  
28 0 return $self;
29 }
30  
31  
32 0 ▶sub _verbose {
Subroutine _verbose: not called CC=3 SCAR=24.8
33 0 my $self = shift;
34  
35 0 ▶ return unless ($self->{verbose} || $self->{debug});
Branch: 1 branch
BranchTrueFalseTotal
unless $self->{"verbose"} or $self->{"debug"} 0 0 0
Condition0%0/3
$self->{"verbose"} or $self->{"debug"}
l!l&&r!l&&!r
000
MC/DC0%0/2
$self->{"verbose"} or $self->{"debug"}
$self->{"verbose"} $self->{"debug"}
Truth table0%0/3
A or B
A= $self->{"verbose"}B= $self->{"debug"}
ABresult
1X1
011
000
36 0 print @_, "\n";
37 }
38  
39  
40 0 ▶sub _debug {
Subroutine _debug: not called CC=2 SCAR=17.9
41 0 my $self = shift;
42  
43 0 ▶ return unless ($self->{debug});
Branch: 1 branch
BranchTrueFalseTotal
unless $self->{"debug"} 0 0 0
44 0 print @_, "\n";
45 }
46  
47  
48 7 1;
49 __END__
« File/State/TempFile.pm ↑ Summary File/Source/FlatFile.pm »