SFDC/Partner.pm

filter: Statementstmt 59.6% 34 / 57 Branchbran 0.0% 0 / 12 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 78.5% 11 / 14 Podpod n/a totaltotal 51.1% 45 / 88 CC 8 SCAR 22.3
CC
8
Cov
47%
setPassword
23.8
_prepareSObjects
15.5
_extractURL
2.0
CRAP 9.3
« SFDC/Tooling.pm ↑ Summary SFDC/Zip.pm »
1 package WWW::SFDC::Partner;
2 # ABSTRACT: Interface to the Salesforce.com Partner API
3  
4 1 ▶use 5.12.0;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 1 our $VERSION = '0.36'; # TRIAL VERSION
9  
10 1 ▶use Data::Dumper;
Subroutine BEGIN: called CC=1 SCAR=0.0
11 1 ▶use Log::Log4perl ':easy';
Subroutine BEGIN: called CC=1 SCAR=0.0
12 1 ▶use Method::Signatures;
Subroutine BEGIN: called CC=1 SCAR=0.0
13 1 ▶use Scalar::Util 'blessed';
Subroutine BEGIN: called CC=1 SCAR=0.0
14 1 ▶use SOAP::Lite;
Subroutine BEGIN: called CC=1 SCAR=0.0
15  
16 1 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
17 1 with "WWW::SFDC::Role::SessionConsumer", "WWW::SFDC::Role::CRUD";
18  
19 1 has 'uri',
20 is => 'ro',
21 default => "urn:partner.soap.sforce.com";
22  
23 0 ▶sub _extractURL { return $_[1]->{serverUrl} }
Subroutine _extractURL: not called CC=1 SCAR=6.9
24  
25 0 ▶method _prepareSObjects (@_) {
Subroutine BEGIN: called CC=1 SCAR=0.4
Subroutine _prepareSObjects: not called CC=4 SCAR=27.4
26 # prepares an array of objects for an update or insert call by converting
27 # it to an array of SOAP::Data
28  
29 0 TRACE "objects for operation", Dumper \@_;
30  
31 return map {
32 0 my $obj = $_;
33 0 my @type;
34 0 ▶ if ($obj->{type}) {
Branch: 1 branch
BranchTrueFalseTotal
if ($obj->{"type"}) 0 0 0
35 0 @type = SOAP::Data->name('type' => $obj->{type});
36 0 delete $obj->{type};
37 }
38  
39 SOAP::Data->name(sObjects => \SOAP::Data->value(
40 @type,
41 map {
42 0 (blessed ($obj->{$_}) and blessed ($obj->{$_}) eq 'SOAP::Data')
43 ? $obj->{$_}
44 0 ▶ : SOAP::Data->name($_ => $obj->{$_})
Branch: 1 branch
BranchTrueFalseTotal
builtin::blessed($obj->{$_}) && builtin::blessed($obj->{$_}) eq 'SOAP::Data' ? : 0 0 0
Condition0%0/3
builtin::blessed($obj->{$_}) and builtin::blessed($obj->{$_}) eq "SOAP::Data"
!ll&&!rl&&r
000
MC/DC0%0/2
builtin::blessed($obj->{$_}) and builtin::blessed($obj->{$_}) eq "SOAP::Data"
builtin::blessed($obj->{$_}) builtin::blessed($obj->{$_}) eq "SOAP::Data"
Truth table0%0/3
A and B
A= builtin::blessed($obj->{$_})B= builtin::blessed($obj->{$_}) eq "SOAP::Data"
ABresult
0X0
100
111
45 } keys %$obj
46 ))
47 } @_;
48 }
49  
50  
51 0 ▶method setPassword (:$Id!, :$Password!){
Subroutine BEGIN: called CC=1 SCAR=5.5
Subroutine setPassword: not called CC=5 SCAR=31.7
Branch: 4 branches
BranchTrueFalseTotal
unless exists $args{"Id"} 0 0 0
unless exists $args{"Password"} 0 0 0
if keys %args 0 0 0
if scalar @_ > 4 0 0 0
52 0 INFO "Setting password for user $Id";
53 0 return $self->_call(
54 'setPassword',
55 SOAP::Data->name(userID => $Id),
56 SOAP::Data->name(password => $Password),
57 );
58 }
59  
60 1 1;
61  
62 __END__
« SFDC/Tooling.pm ↑ Summary SFDC/Zip.pm »