lib/Ubic/Credentials.pm

filter: Statementstmt 77.4% 24 / 31 Branchbran 50.0% 1 / 2 Conditioncond 37.5% 3 / 8 MC/DCmcdc 0.0% 0 / 3 Subroutinesub 58.3% 7 / 12 Podpod 100% 6 / 6 totaltotal 66.1% 41 / 62 SCAR 17.6
CC
5
Cov
68%
import
5.2
new
2.3
set_effective
2.0
CRAP 5.8
« blib/lib/Ubic/SingletonLock.pm ↑ Summary lib/Ubic/Lockf/Alarm.pm »
1 package Ubic::Credentials;
2 172 $Ubic::Credentials::VERSION = '1.59';
3 172 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 172 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 # ABSTRACT: base class for OS-specific credential methods
7  
8  
9 172 ▶use List::MoreUtils qw(uniq);
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 172 ▶use Params::Validate qw(:all);
Subroutine BEGIN: called CC=1 SCAR=0.0
12 172 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
13  
14 172 our $OS_CLASS;
15  
16 sub import {
17 330 ▶ my %module = (
Subroutine import: called CC=4 SCAR=16.4
18 MSWin32 => 'Windows',
19 darwin => 'MacOSX',
20 );
21  
22 330 ▶ my $module = $ENV{UBIC_CREDENTIALS_OS} || $ENV{UBIC_OS} || $module{$^O} || 'POSIX';
Condition37%3/8
$ENV{'UBIC_CREDENTIALS_OS'} || $ENV{'UBIC_OS'} || $module{$^O} || 'POSIX'
l!l
0330
$ENV{"UBIC_CREDENTIALS_OS"} or $ENV{"UBIC_OS"} or $module{$^O}
l!l&&r!l&&!r
00330
$ENV{"UBIC_CREDENTIALS_OS"} or $ENV{"UBIC_OS"}
l!l&&r!l&&!r
00330
MC/DC0%0/3
$ENV{'UBIC_CREDENTIALS_OS'} || $ENV{'UBIC_OS'} || $module{$^O} || 'POSIX'
$ENV{"UBIC_CREDENTIALS_OS"} $ENV{"UBIC_OS"} $module{$^O}
Truth table25%1/4
A or B or C
A= $ENV{"UBIC_CREDENTIALS_OS"}B= $ENV{"UBIC_OS"}C= $module{$^O}
ABCresult
1XX1
01X1
0011
0000
23  
24 330 require "Ubic/Credentials/OS/$module.pm";
25 330 $OS_CLASS = "Ubic::Credentials::OS::$module";
26 }
27  
28  
29 sub new {
30 952 ▶ my $class = shift;
Subroutine new: called CC=2 SCAR=8.1
Pod documented
31 952 ▶ return $OS_CLASS->new(@_) if $class eq 'Ubic::Credentials';
Branch: 1 branch
BranchTrueFalseTotal
if $class eq "Ubic::Credentials" 952 0 952
32 0 croak 'constructor not implemented';
33 }
34  
35 sub set_effective {
36 0 ▶ croak 'not implemented';
Subroutine set_effective: not called CC=1 SCAR=6.9
Pod documented
37 }
38  
39 sub reset_effective {
40 0 ▶ croak 'not implemented';
Subroutine reset_effective: not called CC=1 SCAR=6.9
Pod documented
41 }
42  
43 sub eq {
44 0 ▶ croak 'not implemented';
Subroutine eq: not called CC=1 SCAR=6.9
Pod documented
45 }
46  
47 sub set {
48 0 ▶ croak 'not implemented';
Subroutine set: not called CC=1 SCAR=6.9
Pod documented
49 }
50  
51 sub as_string {
52 0 ▶ my $self = shift;
Subroutine as_string: not called CC=1 SCAR=6.9
Pod documented
53 0 return "$self"; # ugly default stringification; please override in subclasses
54 }
55  
56  
57 172 1;
58  
59 __END__
« blib/lib/Ubic/SingletonLock.pm ↑ Summary lib/Ubic/Lockf/Alarm.pm »