Showing 141 of 176 total issues
Function __construct
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
public function __construct($response = null)
{
$this->CallTagARS = new CallTagARS();
if (null !== $response) {
- 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
File HazMat.php
has 315 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace Ups\Entity;
use DOMDocument;
Function __construct
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
public function __construct(\stdClass $response = null)
{
$this->TransitFrom = new Address();
$this->TransitTo = new Address();
$this->ShipmentWeight = new ShipmentWeight();
- 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
File InternationalForms.php
has 306 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace Ups\Entity;
use DateTime;
Package
has 28 functions (exceeds 20 allowed). Consider refactoring. Open
class Package implements NodeInterface
{
const PKG_OVERSIZE1 = '1';
const PKG_OVERSIZE2 = '2';
const PKG_LARGE = '4';
Function toNode
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
public function toNode(DOMDocument $document = null)
{
if (null === $document) {
$document = 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
Function __construct
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
public function __construct(\stdClass $attributes = null)
{
$this->address = new Address();
if (null !== $attributes) {
- 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 toNode
has 80 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function toNode(DOMDocument $document = null)
{
if (null === $document) {
$document = new DOMDocument();
}
Method __construct
has 75 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __construct($attributes = null)
{
if (null !== $attributes) {
if (isset($attributes->AddressLine1)) {
$this->setAddressLine1($attributes->AddressLine1);
Function __construct
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
public function __construct($attributes = null)
{
$this->address = new Address();
if (null !== $attributes) {
- 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 createRequest
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
private function createRequest()
{
$xml = new DOMDocument();
$xml->formatOutput = true;
- 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 __construct
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __construct(\stdClass $response = null)
{
$this->AddressExtendedInformation = [];
if (null !== $response) {
Method request
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function request($access, $request, $endpointurl, $operation = null, $wsdl = null)
{
// Check for operation
if (is_null($operation)) {
throw new \Exception('Operation is required');
Method createRequest
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function createRequest(RateRequest $rateRequest)
{
$shipment = $rateRequest->getShipment();
$document = $xml = new DOMDocument();
ShipTo
has 24 functions (exceeds 20 allowed). Consider refactoring. Open
class ShipTo implements NodeInterface
{
/** @deprecated */
public $LocationID;
/** @deprecated */
Shipment
has 24 functions (exceeds 20 allowed). Consider refactoring. Open
class Shipment implements NodeInterface
{
const TRANSPORT_MODE_AIR = 1;
const TRANSPORT_MODE_GROUND = 2;
const TRANSPORT_MODE_RAIL = 3;
Function __construct
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
public function __construct($attributes = null)
{
if (null !== $attributes) {
if (isset($attributes->FormType)) {
$this->setType($attributes->FormType);
- 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
File Shipment.php
has 272 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace Ups\Entity;
class Shipment
Shipper
has 22 functions (exceeds 20 allowed). Consider refactoring. Open
class Shipper implements NodeInterface
{
/**
* @var string
*/
Method toNode
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function toNode(DOMDocument $document = null)
{
if (null === $document) {
$document = new DOMDocument();
}