Showing 29 of 40 total issues
Account
has 55 functions (exceeds 20 allowed). Consider refactoring. Open
Open
class Account extends MoipResource
{
/**
* Path accounts API.
*
Orders
has 54 functions (exceeds 20 allowed). Consider refactoring. Open
Open
class Orders extends MoipResource
{
/**
* @const string
*/
Payment
has 42 functions (exceeds 20 allowed). Consider refactoring. Open
Open
class Payment extends MoipResource
{
/**
* @const string
*/
File Account.php
has 366 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
<?php
namespace Moip\Resource;
use Moip\Exceptions\ValidationException;
File Orders.php
has 326 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
<?php
namespace Moip\Resource;
use ArrayIterator;
File Payment.php
has 313 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
<?php
namespace Moip\Resource;
use Requests;
BankAccount
has 24 functions (exceeds 20 allowed). Consider refactoring. Open
Open
class BankAccount extends MoipResource
{
/**
* Path bank accounts API.
*
Customer
has 24 functions (exceeds 20 allowed). Consider refactoring. Open
Open
class Customer extends MoipResource
{
/**
* Path customers API.
*
Connect
has 24 functions (exceeds 20 allowed). Consider refactoring. Open
Open
class Connect implements Authentication, JsonSerializable
{
/**
* @const string
*/
Method populate
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected function populate(stdClass $response)
{
$account = clone $this;
$account->data->email = new stdClass();
Method populate
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected function populate(stdClass $response)
{
$refund = clone $this;
$refund->data->id = $this->getIfSet('id', $response);
Method setAddress
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public function setAddress($type, $street, $number, $district, $city, $state, $zip, $complement = null, $country = self::ADDRESS_COUNTRY)
Method addAddress
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public function addAddress($type, $street, $number, $district, $city, $state, $zip, $complement = null, $country = self::ADDRESS_COUNTRY)
Function httpRequest
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
Open
protected function httpRequest($path, $method, $payload = null, $headers = [])
{
$http_sess = $this->moip->getSession();
$body = null;
if ($payload !== null) {
- 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 httpRequest
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected function httpRequest($path, $method, $payload = null, $headers = [])
{
$http_sess = $this->moip->getSession();
$body = null;
if ($payload !== null) {
Method addAddress
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public function addAddress($street, $number, $district, $city, $state, $zip, $complement = null, $country = self::ADDRESS_COUNTRY)
Method bankAccountPartial
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public function bankAccountPartial($amount, $type, $bankNumber, $agencyNumber, $agencyCheckNumber, $accountNumber, $accountCheckNumber, Customer $holder)
Method setCompanyAddress
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public function setCompanyAddress($street, $number, $district, $city, $state, $zip, $complement = null, $country = self::ADDRESS_COUNTRY)
Method bankAccountDataCustomer
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
private function bankAccountDataCustomer($type, $bankNumber, $agencyNumber, $agencyCheckNumber, $accountNumber, $accountCheckNumber, Customer $holder)
Method bankAccountFull
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public function bankAccountFull($type, $bankNumber, $agencyNumber, $agencyCheckNumber, $accountNumber, $accountCheckNumber, Customer $holder)