brandon14/ebay-sdk-php

View on GitHub

Showing 3,709 of 3,709 total issues

File ListingViolationApi.php has 371 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/Compliance/V1/Api/ListingViolationApi.php - About 4 hrs to fix

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

        public function updateConfigAsyncWithHttpInfo($config = null)
        {
            $returnType = '';
            $request = $this->updateConfigRequest($config);
    
    
    Severity: Major
    Found in src/Commerce/Notification/V1/Api/ConfigApi.php and 1 other location - About 4 hrs to fix
    src/Commerce/MediaBeta/V1/Api/VideoApi.php on lines 237..255

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 180.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

        public function createVideoAsyncWithHttpInfo($body = null)
        {
            $returnType = '';
            $request = $this->createVideoRequest($body);
    
    
    Severity: Major
    Found in src/Commerce/MediaBeta/V1/Api/VideoApi.php and 1 other location - About 4 hrs to fix
    src/Commerce/Notification/V1/Api/ConfigApi.php on lines 463..481

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 180.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Method searchByImageRequest has 119 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function searchByImageRequest($aspect_filter = null, $category_ids = null, $charity_ids = null, $fieldgroups = null, $filter = null, $limit = null, $offset = null, $sort = null, $search_by_image_request = null)
        {
            $resourcePath = '/item_summary/search_by_image';
            $formParams = [];
            $queryParams = [];
    Severity: Major
    Found in src/Buy/Browse/V1/Api/SearchByImageApi.php - About 4 hrs to fix

      Function updateKeywordRequest has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
      Open

          public function updateKeywordRequest($campaign_id, $keyword_id, $update_keyword_request)
          {
              // Verify the required parameter 'campaign_id' is set.
              if ($campaign_id === null || (\is_array($campaign_id) && count($campaign_id) === 0)) {
                  throw new \InvalidArgumentException('Missing the required parameter $campaign_id when calling updateKeyword');
      Severity: Minor
      Found in src/Sell/Marketing/V1/Api/KeywordApi.php - About 4 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

      Function suggestBidsRequest has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
      Open

          public function suggestBidsRequest($ad_group_id, $campaign_id, $targeted_bid_request)
          {
              // Verify the required parameter 'ad_group_id' is set.
              if ($ad_group_id === null || (\is_array($ad_group_id) && count($ad_group_id) === 0)) {
                  throw new \InvalidArgumentException('Missing the required parameter $ad_group_id when calling suggestBids');
      Severity: Minor
      Found in src/Sell/Marketing/V1/Api/AdGroupApi.php - About 4 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

      Function updateBidRequest has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
      Open

          public function updateBidRequest($ad_id, $campaign_id, $update_bid_percentage_request)
          {
              // Verify the required parameter 'ad_id' is set.
              if ($ad_id === null || (\is_array($ad_id) && count($ad_id) === 0)) {
                  throw new \InvalidArgumentException('Missing the required parameter $ad_id when calling updateBid');
      Severity: Minor
      Found in src/Sell/Marketing/V1/Api/AdApi.php - About 4 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

      Function updateAdGroupRequest has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
      Open

          public function updateAdGroupRequest($ad_group_id, $campaign_id, $update_ad_group_request)
          {
              // Verify the required parameter 'ad_group_id' is set.
              if ($ad_group_id === null || (\is_array($ad_group_id) && count($ad_group_id) === 0)) {
                  throw new \InvalidArgumentException('Missing the required parameter $ad_group_id when calling updateAdGroup');
      Severity: Minor
      Found in src/Sell/Marketing/V1/Api/AdGroupApi.php - About 4 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

      Function createOrReplaceSalesTaxRequest has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
      Open

          public function createOrReplaceSalesTaxRequest($country_code, $jurisdiction_id, $sales_tax_base)
          {
              // Verify the required parameter 'country_code' is set.
              if ($country_code === null || (\is_array($country_code) && count($country_code) === 0)) {
                  throw new \InvalidArgumentException('Missing the required parameter $country_code when calling createOrReplaceSalesTax');
      Severity: Minor
      Found in src/Sell/Account/V1/Api/SalesTaxApi.php - About 4 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

      Function updateCustomPolicyRequest has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
      Open

          public function updateCustomPolicyRequest($custom_policy_id, $x_ebay_c_marketplace_id, $custom_policy_request)
          {
              // Verify the required parameter 'custom_policy_id' is set.
              if ($custom_policy_id === null || (\is_array($custom_policy_id) && count($custom_policy_id) === 0)) {
                  throw new \InvalidArgumentException('Missing the required parameter $custom_policy_id when calling updateCustomPolicy');
      Severity: Minor
      Found in src/Sell/Account/V1/Api/CustomPolicyApi.php - About 4 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

      SearchPagedCollection has 36 functions (exceeds 20 allowed). Consider refactoring.
      Open

      class SearchPagedCollection implements ModelInterface, \ArrayAccess, \JsonSerializable
      {
          public const DISCRIMINATOR = null;
      
          /**
      Severity: Minor
      Found in src/Buy/Browse/V1/Model/SearchPagedCollection.php - About 4 hrs to fix

        Event has 36 functions (exceeds 20 allowed). Consider refactoring.
        Open

        class Event implements ModelInterface, \ArrayAccess, \JsonSerializable
        {
            public const DISCRIMINATOR = null;
        
            /**
        Severity: Minor
        Found in src/Buy/Deal/V1/Model/Event.php - About 4 hrs to fix

          PricingSummaryV2 has 36 functions (exceeds 20 allowed). Consider refactoring.
          Open

          class PricingSummaryV2 implements ModelInterface, \ArrayAccess, \JsonSerializable
          {
              public const DISCRIMINATOR = null;
          
              /**
          Severity: Minor
          Found in src/Buy/Order/V2/Model/PricingSummaryV2.php - About 4 hrs to fix

            Campaign has 36 functions (exceeds 20 allowed). Consider refactoring.
            Open

            class Campaign implements ModelInterface, \ArrayAccess, \JsonSerializable
            {
                public const DISCRIMINATOR = null;
            
                /**
            Severity: Minor
            Found in src/Sell/Marketing/V1/Model/Campaign.php - About 4 hrs to fix

              PaymentPolicy has 36 functions (exceeds 20 allowed). Consider refactoring.
              Open

              class PaymentPolicy implements ModelInterface, \ArrayAccess, \JsonSerializable
              {
                  public const DISCRIMINATOR = null;
              
                  /**
              Severity: Minor
              Found in src/Sell/Account/V1/Model/PaymentPolicy.php - About 4 hrs to fix

                InventoryLocationFull has 36 functions (exceeds 20 allowed). Consider refactoring.
                Open

                class InventoryLocationFull implements ModelInterface, \ArrayAccess, \JsonSerializable
                {
                    public const DISCRIMINATOR = null;
                
                    /**
                Severity: Minor
                Found in src/Sell/Account/V1/Model/InventoryLocationFull.php - About 4 hrs to fix

                  InventoryLocationFull has 36 functions (exceeds 20 allowed). Consider refactoring.
                  Open

                  class InventoryLocationFull implements ModelInterface, \ArrayAccess, \JsonSerializable
                  {
                      public const DISCRIMINATOR = null;
                  
                      /**
                  Severity: Minor
                  Found in src/Sell/Inventory/V1/Model/InventoryLocationFull.php - About 4 hrs to fix

                    AspectConstraint has 36 functions (exceeds 20 allowed). Consider refactoring.
                    Open

                    class AspectConstraint implements ModelInterface, \ArrayAccess, \JsonSerializable
                    {
                        public const DISCRIMINATOR = null;
                    
                        /**
                    Severity: Minor
                    Found in src/Commerce/Taxonomy/V1/Model/AspectConstraint.php - About 4 hrs to fix

                      Function getItemGroupFeedRequest has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public function getItemGroupFeedRequest($accept, $x_ebay_c_marketplace_id, $feed_scope, $category_id, $range = null, $date = null)
                          {
                              // Verify the required parameter 'accept' is set.
                              if ($accept === null || (\is_array($accept) && count($accept) === 0)) {
                                  throw new \InvalidArgumentException('Missing the required parameter $accept when calling getItemGroupFeed');
                      Severity: Minor
                      Found in src/Buy/FeedBeta/V1/Api/ItemGroupApi.php - About 4 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

                      Function createOrReplaceProductCompatibilityRequest has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public function createOrReplaceProductCompatibilityRequest($content_language, $sku, $compatibility)
                          {
                              // Verify the required parameter 'content_language' is set.
                              if ($content_language === null || (\is_array($content_language) && count($content_language) === 0)) {
                                  throw new \InvalidArgumentException('Missing the required parameter $content_language when calling createOrReplaceProductCompatibility');
                      Severity: Minor
                      Found in src/Sell/Inventory/V1/Api/ProductCompatibilityApi.php - About 4 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

                      Severity
                      Category
                      Status
                      Source
                      Language