Showing 10 of 10 total issues
File MarketoSoapApiClient.php
has 359 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Core file of the Marketo SOAP API Client project
*
* @category SOAP_API_Client
Method scheduleCampaign
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function scheduleCampaign(
$programName,
$campaignName,
$tokens,
$runAt = null
Method runCampaignOnLeads
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function runCampaignOnLeads($campaignKey, $leads, $tokens = null){
$leadKeys = array();
foreach ($leads as $key => $element){
if (is_array($element)){
Method __construct
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
$userId,
$secretKey,
$soapClient,
$options = array(),
$namespace = 'http://www.marketo.com/mktows/',
Method __construct
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
$userId,
$secretKey,
$soapClient,
$options = array(),
$namespace = 'http://www.marketo.com/mktows/',
Function runCampaignOnLeads
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function runCampaignOnLeads($campaignKey, $leads, $tokens = null){
$leadKeys = array();
foreach ($leads as $key => $element){
if (is_array($element)){
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function buildLeadRecord
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function buildLeadRecord($leadAttributes, $leadKey = null){
$record = new stdClass;
// Identify the lead if it is known
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function prepareLeadActivityResults
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected function prepareLeadActivityResults($marketo_result) {
if ($marketo_result->leadActivityList->returnCount > 1) {
$activity = $marketo_result->leadActivityList->activityRecordList->activityRecord;
}
elseif ($marketo_result->leadActivityList->returnCount == 1) {
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function keyType
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected function keyType($key) {
if (filter_var($key, FILTER_VALIDATE_EMAIL)) {
$type = 'EMAIL';
}
elseif (is_int($key) || (is_string($key) && ctype_digit($key))) {
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function flattenAttributes
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected function flattenAttributes($attributes){
$types = array('integer', 'string', 'boolean', 'float');
$flattenedAttributes = array();
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"