blib/lib/Log/Accounting.pm

filter: Statementstmt 64.0% 16 / 25 Branchbran 0.0% 0 / 2 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 75.0% 3 / 4 Podpod 0.0% 0 / 1 totaltotal 51.3% 19 / 37 CC 3 SCAR 15.1
CC
3
Cov
53%
new
8.0
BEGIN
1.0
BEGIN
1.0
CRAP 4.5
↑ Summary
1 package Log::Accounting;
2  
3 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %MMAP);
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 1 require Exporter;
7 1 require AutoLoader;
8  
9 1 @ISA = qw(Exporter AutoLoader);
10 # Items to export into callers namespace by default. Note: do not export
11 # names by default without a very good reason. Use EXPORT_OK instead.
12 # Do not simply export all your public functions/methods/constants.
13 1 @EXPORT = qw(
14
15 );
16 1 $VERSION = '0.3';
17  
18 1 %MMAP = (
19 "Sendmail" => "Log::Accounting::Sendmail",
20 );
21  
22  
23 0 ▶sub new {
Subroutine new: not called CC=3 SCAR=20.8
Pod undocumented
24 0 shift;
25 0 my $service = shift;
26 0 ▶ my $impl = $MMAP{$service} || do {
Condition0%0/3
$Log::Accounting::MMAP{$service} || do { $service =~ s/\W+//; "Log::Accounting::$service" }
l!l&&r!l&&!r
000
MC/DC0%0/2
$Log::Accounting::MMAP{$service} || do { $service =~ s/\W+//; "Log::Accounting::$service" }
$Log::Accounting::MMAP{$service} do { $service =~ s/\W+//; "Log::Accounting::$service" }
Truth table0%0/3
A || B
A= $Log::Accounting::MMAP{$service}B= do { $service =~ s/\W+//; "Log::Accounting::$service" }
ABresult
1X1
011
000
27 0 $service =~ s/\W+//;
28 0 "Log::Accounting::$service";
29 };
30 1 ▶ no strict 'refs';
Subroutine BEGIN: called CC=1 SCAR=0.0
31 0 ▶ unless (exists ${"$impl\::"}{"VERSION"}) {
Branch: 1 branch
BranchTrueFalseTotal
unless (exists do { "${impl}::" }->{"VERSION"}) 0 0 0
32 0 eval "require $impl";
33 }
34 0 return $impl->new(@_);
35 }
36  
37 1 1;
38 __END__
↑ Summary