Showing 33 of 72 total issues
Request
has 77 functions (exceeds 20 allowed). Consider refactoring. Open
Open
class Request
{
// Option constants
const SERIALIZE_PAYLOAD_NEVER = 0;
File Request.php
has 583 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
<?php
namespace Httpful;
use Httpful\Exception\ConnectionErrorException;
Widget
has 55 functions (exceeds 20 allowed). Consider refactoring. Open
Open
class Widget
{
private $_itemName;
File ItemRepository.php
has 412 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
<?php
namespace PromisePay;
use PromisePay\DataObjects\BPayDetails;
use PromisePay\DataObjects\Fee;
Item
has 37 functions (exceeds 20 allowed). Consider refactoring. Open
Open
class Item extends Object
{
/**
* @var
*/
Token
has 33 functions (exceeds 20 allowed). Consider refactoring. Open
Open
class Token
{
/**
* @var
*/
Function _curlPrep
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
Open
public function _curlPrep()
{
// Check for required stuff
if (!isset($this->uri))
throw new \Exception('Attempting to send a request before defining a URI endpoint.');
- 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
User
has 31 functions (exceeds 20 allowed). Consider refactoring. Open
Open
class User extends Object
{
/**
* @var
*/
Method _curlPrep
has 85 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function _curlPrep()
{
// Check for required stuff
if (!isset($this->uri))
throw new \Exception('Attempting to send a request before defining a URI endpoint.');
File UserRepository.php
has 301 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
<?php
namespace PromisePay;
use PromisePay\DataObjects\BankAccount;
use PromisePay\DataObjects\CardAccount;
WireDetails
has 25 functions (exceeds 20 allowed). Consider refactoring. Open
Open
class WireDetails
{
private $_beneficiary;
private $_addressLine1;
private $_city;
File Widget.php
has 280 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
<?php
namespace PromisePay\DataObjects;
/**
* Class Widget
Company
has 23 functions (exceeds 20 allowed). Consider refactoring. Open
Open
class Company extends Object
{
/**
* @var
*/
ItemRepository
has 22 functions (exceeds 20 allowed). Consider refactoring. Open
Open
class ItemRepository extends ApiAbstract
{
public function getListOfItems($limit = 20, $offset = 0)
{
$this->paramsListCorrect($limit,$offset);
Function _future_serializeAsXml
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
Open
private function _future_serializeAsXml($value, $node = null, $dom = null)
{
if (!$dom) {
$dom = new \DOMDocument;
}
- 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
Method isCorrectCountryCode
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function isCorrectCountryCode($Country)
{
$allowedCountryCode = array(
"AFG", "ALA", "ALB", "DZA", "ASM", "AND", "AGO", "AIA", "ATA",
"ATG", "ARG", "ARM", "ABW", "AUS", "AUT", "AZE", "BHS", "BHR",
Method createUser
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function createUser(User $user)
{
$this->validateUser($user);
$payload = '';
$preparePayload = array(
Method updateUser
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function updateUser(User $user)
{
$this->validateUser($user);
$payload = '';
Method updateItem
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function updateItem(Item $item, $user = null, $account = null, $releaseAmount = null)
{
$payload = '';
$preparePayload = array(
'id'=>$item->getId(),
Method createFee
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function createFee(Fee $fee)
{
$this->ValidateFee($fee);
$payload = '';
$preparePayload = array(