brandon14/ebay-sdk-php

View on GitHub
src/Sell/Account/V2/Api/RateTableApi.php

Summary

Maintainability
D
2 days
Test Coverage

File RateTableApi.php has 347 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

/**
 * This file is part of the trollandtoad/ebay-sdk-php package.
 *
Severity: Minor
Found in src/Sell/Account/V2/Api/RateTableApi.php - About 4 hrs to fix

    Function updateShippingCostRequest has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
    Open

        public function updateShippingCostRequest($rate_table_id, $rate_table_update = null)
        {
            // Verify the required parameter 'rate_table_id' is set.
            if ($rate_table_id === null || (\is_array($rate_table_id) && count($rate_table_id) === 0)) {
                throw new \InvalidArgumentException('Missing the required parameter $rate_table_id when calling updateShippingCost');
    Severity: Minor
    Found in src/Sell/Account/V2/Api/RateTableApi.php - About 3 hrs to fix

    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 updateShippingCostRequest has 70 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function updateShippingCostRequest($rate_table_id, $rate_table_update = null)
        {
            // Verify the required parameter 'rate_table_id' is set.
            if ($rate_table_id === null || (\is_array($rate_table_id) && count($rate_table_id) === 0)) {
                throw new \InvalidArgumentException('Missing the required parameter $rate_table_id when calling updateShippingCost');
    Severity: Major
    Found in src/Sell/Account/V2/Api/RateTableApi.php - About 2 hrs to fix

      Function getRateTableRequest has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
      Open

          public function getRateTableRequest($rate_table_id)
          {
              // Verify the required parameter 'rate_table_id' is set.
              if ($rate_table_id === null || (\is_array($rate_table_id) && count($rate_table_id) === 0)) {
                  throw new \InvalidArgumentException('Missing the required parameter $rate_table_id when calling getRateTable');
      Severity: Minor
      Found in src/Sell/Account/V2/Api/RateTableApi.php - About 2 hrs to fix

      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 getRateTableRequest has 64 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function getRateTableRequest($rate_table_id)
          {
              // Verify the required parameter 'rate_table_id' is set.
              if ($rate_table_id === null || (\is_array($rate_table_id) && count($rate_table_id) === 0)) {
                  throw new \InvalidArgumentException('Missing the required parameter $rate_table_id when calling getRateTable');
      Severity: Major
      Found in src/Sell/Account/V2/Api/RateTableApi.php - About 2 hrs to fix

        Method getRateTableWithHttpInfo has 53 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function getRateTableWithHttpInfo($rate_table_id)
            {
                $request = $this->getRateTableRequest($rate_table_id);
        
                try {
        Severity: Major
        Found in src/Sell/Account/V2/Api/RateTableApi.php - About 2 hrs to fix

          Function getRateTableWithHttpInfo has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
          Open

              public function getRateTableWithHttpInfo($rate_table_id)
              {
                  $request = $this->getRateTableRequest($rate_table_id);
          
                  try {
          Severity: Minor
          Found in src/Sell/Account/V2/Api/RateTableApi.php - About 1 hr to fix

          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 updateShippingCostWithHttpInfo has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

              public function updateShippingCostWithHttpInfo($rate_table_id, $rate_table_update = null)
              {
                  $request = $this->updateShippingCostRequest($rate_table_id, $rate_table_update);
          
                  try {
          Severity: Minor
          Found in src/Sell/Account/V2/Api/RateTableApi.php - About 35 mins to fix

          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

          There are no issues that match your filters.

          Category
          Status