SFDC/Tooling.pm

filter: Statementstmt 47.7% 21 / 44 Branchbran 0.0% 0 / 10 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 46.1% 6 / 13 Podpod 100% 5 / 5 totaltotal 41.5% 32 / 77 CC 7 SCAR 22.3
CC
7
Cov
37%
_prepareSObjects
20.0
executeAnonymous
20.0
_extractURL
2.0
CRAP 9.3
« SFDC/Metadata.pm ↑ Summary SFDC/Partner.pm »
1 package WWW::SFDC::Tooling;
2 # ABSTRACT: Interface to the Salesforce.com Tooling 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 Log::Log4perl ':easy';
Subroutine BEGIN: called CC=1 SCAR=0.0
11 1 ▶use Scalar::Util 'blessed';
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 1 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
14 1 with 'WWW::SFDC::Role::SessionConsumer', 'WWW::SFDC::Role::CRUD';
15  
16 1 has 'uri',
17 is => 'ro',
18 default => 'urn:tooling.soap.sforce.com';
19  
20 0 ▶sub _extractURL {
Subroutine _extractURL: not called CC=1 SCAR=6.9
21 0 return $_[1]->{serverUrl} =~ s{/u/}{/T/}r;
22 }
23  
24 0 ▶sub _prepareSObjects {
Subroutine _prepareSObjects: not called CC=4 SCAR=30.0
25 0 my $self = shift;
26 # prepares an array of objects for an update or insert call by converting
27 # it to an array of SOAP::Data
28  
29 # THIS IMPLEMENTATION IS DIFFERENT TO THE EQUIVALENT PARTNER API IMPLEMENTATION
30  
31 0 TRACE "objects for operation" => \@_;
32  
33 return map {
34 0 my $obj = $_;
35 0 my $type;
36 0 ▶ if ($obj->{type}) {
Branch: 1 branch
BranchTrueFalseTotal
if ($obj->{"type"}) 0 0 0
37 0 $type = $obj->{type};
38 0 delete $obj->{type};
39 }
40  
41 SOAP::Data->name(sObjects => \SOAP::Data->value(
42 map {
43 0 (blessed ($obj->{$_}) and blessed ($obj->{$_}) eq 'SOAP::Data')
44 ? $obj->{$_}
45 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
46 } keys %$obj
47 ))->type($type)
48 } @_;
49 }
50  
51  
52 0 ▶sub describeGlobal {
Subroutine describeGlobal: not called CC=1 SCAR=6.9
Pod documented
53 ...
54 0 }
55  
56  
57 0 ▶sub describeSObjects {
Subroutine describeSObjects: not called CC=1 SCAR=6.9
Pod documented
58 ...
59 0 }
60  
61  
62 0 ▶sub executeAnonymous {
Subroutine executeAnonymous: not called CC=4 SCAR=30.0
Pod documented
63 0 my ($self, $code, %options) = @_;
64 my $result = $self->_call(
65 'executeAnonymous',
66 SOAP::Data->name(string => $code),
67 0 ▶ $options{debug} ? SOAP::Header->name('DebuggingHeader' => \SOAP::Data->name(
Branch: 1 branch
BranchTrueFalseTotal
$options{'debug'} ? : 0 0 0
68 debugLevel => 'DEBUGONLY'
69 )) : (),
70 )->result;
71  
72 LOGDIE "ExecuteAnonymous failed to compile: " . $result->{compileProblem}
73 0 ▶ if $result->{compiled} eq "false";
Branch: 1 branch
BranchTrueFalseTotal
if $result->{"compiled"} eq "false" 0 0 0
74  
75 LOGDIE "ExecuteAnonymous failed to complete: " . $result->{exceptionMessage}
76 0 ▶ if $result->{success} eq "false";
Branch: 1 branch
BranchTrueFalseTotal
if $result->{"success"} eq "false" 0 0 0
77  
78 0 return $result;
79 }
80  
81  
82 0 ▶sub runTests {
Subroutine runTests: not called CC=1 SCAR=6.9
Pod documented
83 0 my ($self, @names) = @_;
84  
85 return $self->_call(
86 'runTests',
87 0 map {\SOAP::Data->name(classes => $_)} @names
88 )->result;
89 }
90  
91  
92 0 ▶sub runTestsAsynchronous {
Subroutine runTestsAsynchronous: not called CC=1 SCAR=6.9
Pod documented
93 0 my ($self, @ids) = @_;
94  
95 0 return $self->_call('runTestsAsynchronous', join ",", @ids)->result;
96 }
97  
98 1 1;
99  
100 __END__
« SFDC/Metadata.pm ↑ Summary SFDC/Partner.pm »