Showing 13 of 13 total issues
Similar blocks of code found in 2 locations. Consider refactoring. Open
public function connect($customerUUID, array $subscriptions) { $arr = []; for ($i = 0; $i < count($subscriptions); $i++) { $arr[$i] = $subscriptions[$i];
- Read upRead up
Similar blocks of code found in 2 locations. Consider refactoring. Open
public function disconnect($customerUUID, array $subscriptions) { $arr = []; for ($i = 0; $i < count($subscriptions); $i++) { $arr[$i] = $subscriptions[$i];
- Read upRead up
Similar blocks of code found in 2 locations. Consider refactoring. Open
protected function setLineItem($index, $line) { if ($line instanceof AbstractLineItem) { $this->line_items[$index] = $line; } elseif (is_array($line) && isset($line['type']) && $line['type'] === 'one_time') {
- Read upRead up
Similar blocks of code found in 2 locations. Consider refactoring. Open
protected function setTransaction($index, $tr) { if ($tr instanceof AbstractTransaction) { $this->transactions[$index] = $tr; } elseif (is_array($tr) && isset($tr['type']) && $tr['type'] === 'payment') {
- Read upRead up
Customer
has 21 functions (exceeds 20 allowed). Consider refactoring. Open
class Customer extends AbstractResource{ use CreateTrait; use AllTrait; use GetTrait;
File Customer.php
has 253 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php namespace ChartMogul; use ChartMogul\Resource\AbstractResource;
Method handleResponse
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function handleResponse(ResponseInterface $response) { $response->getBody()->rewind(); $data = json_decode($response->getBody()->getContents(), true); switch ($response->getStatusCode()) {
Similar blocks of code found in 4 locations. Consider refactoring. Open
<?php namespace ChartMogul\Metrics; use ChartMogul\Resource\AbstractResource;
- Read upRead up
Similar blocks of code found in 4 locations. Consider refactoring. Open
<?php namespace ChartMogul\Metrics\Customers; use ChartMogul\Resource\AbstractResource;
- Read upRead up
Similar blocks of code found in 4 locations. Consider refactoring. Open
<?php namespace ChartMogul\Metrics; use ChartMogul\Resource\AbstractResource;
- Read upRead up
Similar blocks of code found in 4 locations. Consider refactoring. Open
<?php namespace ChartMogul\Metrics\Customers; use ChartMogul\Resource\AbstractResource;
- Read upRead up
Method unmerge
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public static function unmerge($customer_uuid, $external_id, $data_source_uuid, array $move_to_new_customer = [], ?ClientInterface $client = null)
Function allData
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public static function allData(array $data, Collection $array) { if (isset($data["current_page"])) { $array->current_page = $data["current_page"]; }
- Read upRead up