File ShipmentApi.php
has 707 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* This file is part of the trollandtoad/ebay-sdk-php package.
*
Function createFromShippingQuoteRequest
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
public function createFromShippingQuoteRequest($create_shipment_from_quote_request)
{
// Verify the required parameter 'create_shipment_from_quote_request' is set.
if ($create_shipment_from_quote_request === null || (\is_array($create_shipment_from_quote_request) && count($create_shipment_from_quote_request) === 0)) {
throw new \InvalidArgumentException('Missing the required parameter $create_shipment_from_quote_request when calling createFromShippingQuote');
- 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
ShipmentApi
has 25 functions (exceeds 20 allowed). Consider refactoring. Open
class ShipmentApi
{
/**
* @var ClientInterface
*/
Function downloadLabelFileRequest
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
public function downloadLabelFileRequest($shipment_id)
{
// Verify the required parameter 'shipment_id' is set.
if ($shipment_id === null || (\is_array($shipment_id) && count($shipment_id) === 0)) {
throw new \InvalidArgumentException('Missing the required parameter $shipment_id when calling downloadLabelFile');
- 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 getShipmentRequest
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
public function getShipmentRequest($shipment_id)
{
// Verify the required parameter 'shipment_id' is set.
if ($shipment_id === null || (\is_array($shipment_id) && count($shipment_id) === 0)) {
throw new \InvalidArgumentException('Missing the required parameter $shipment_id when calling getShipment');
- 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 cancelShipmentRequest
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
public function cancelShipmentRequest($shipment_id)
{
// Verify the required parameter 'shipment_id' is set.
if ($shipment_id === null || (\is_array($shipment_id) && count($shipment_id) === 0)) {
throw new \InvalidArgumentException('Missing the required parameter $shipment_id when calling cancelShipment');
- 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 downloadLabelFileRequest
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function downloadLabelFileRequest($shipment_id)
{
// Verify the required parameter 'shipment_id' is set.
if ($shipment_id === null || (\is_array($shipment_id) && count($shipment_id) === 0)) {
throw new \InvalidArgumentException('Missing the required parameter $shipment_id when calling downloadLabelFile');
Method cancelShipmentRequest
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function cancelShipmentRequest($shipment_id)
{
// Verify the required parameter 'shipment_id' is set.
if ($shipment_id === null || (\is_array($shipment_id) && count($shipment_id) === 0)) {
throw new \InvalidArgumentException('Missing the required parameter $shipment_id when calling cancelShipment');
Method getShipmentRequest
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getShipmentRequest($shipment_id)
{
// Verify the required parameter 'shipment_id' is set.
if ($shipment_id === null || (\is_array($shipment_id) && count($shipment_id) === 0)) {
throw new \InvalidArgumentException('Missing the required parameter $shipment_id when calling getShipment');
Method createFromShippingQuoteRequest
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function createFromShippingQuoteRequest($create_shipment_from_quote_request)
{
// Verify the required parameter 'create_shipment_from_quote_request' is set.
if ($create_shipment_from_quote_request === null || (\is_array($create_shipment_from_quote_request) && count($create_shipment_from_quote_request) === 0)) {
throw new \InvalidArgumentException('Missing the required parameter $create_shipment_from_quote_request when calling createFromShippingQuote');
Method downloadLabelFileWithHttpInfo
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function downloadLabelFileWithHttpInfo($shipment_id)
{
$request = $this->downloadLabelFileRequest($shipment_id);
try {
Method getShipmentWithHttpInfo
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getShipmentWithHttpInfo($shipment_id)
{
$request = $this->getShipmentRequest($shipment_id);
try {
Method createFromShippingQuoteWithHttpInfo
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function createFromShippingQuoteWithHttpInfo($create_shipment_from_quote_request)
{
$request = $this->createFromShippingQuoteRequest($create_shipment_from_quote_request);
try {
Method cancelShipmentWithHttpInfo
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function cancelShipmentWithHttpInfo($shipment_id)
{
$request = $this->cancelShipmentRequest($shipment_id);
try {
Function downloadLabelFileWithHttpInfo
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function downloadLabelFileWithHttpInfo($shipment_id)
{
$request = $this->downloadLabelFileRequest($shipment_id);
try {
- 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 createFromShippingQuoteWithHttpInfo
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function createFromShippingQuoteWithHttpInfo($create_shipment_from_quote_request)
{
$request = $this->createFromShippingQuoteRequest($create_shipment_from_quote_request);
try {
- 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 getShipmentWithHttpInfo
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function getShipmentWithHttpInfo($shipment_id)
{
$request = $this->getShipmentRequest($shipment_id);
try {
- 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 cancelShipmentWithHttpInfo
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function cancelShipmentWithHttpInfo($shipment_id)
{
$request = $this->cancelShipmentRequest($shipment_id);
try {
- 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"