brandon14/ebay-sdk-php

View on GitHub
src/Buy/OfferBeta/V1/Api/BiddingApi.php

Summary

Maintainability
F
1 wk
Test Coverage

File BiddingApi.php has 400 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/Buy/OfferBeta/V1/Api/BiddingApi.php - About 5 hrs to fix

    Function placeProxyBidRequest has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
    Open

        public function placeProxyBidRequest($item_id, $x_ebay_c_marketplace_id, $place_proxy_bid_request = null)
        {
            // Verify the required parameter 'item_id' is set.
            if ($item_id === null || (\is_array($item_id) && count($item_id) === 0)) {
                throw new \InvalidArgumentException('Missing the required parameter $item_id when calling placeProxyBid');
    Severity: Minor
    Found in src/Buy/OfferBeta/V1/Api/BiddingApi.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 getBiddingRequest has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
    Open

        public function getBiddingRequest($item_id, $x_ebay_c_marketplace_id)
        {
            // Verify the required parameter 'item_id' is set.
            if ($item_id === null || (\is_array($item_id) && count($item_id) === 0)) {
                throw new \InvalidArgumentException('Missing the required parameter $item_id when calling getBidding');
    Severity: Minor
    Found in src/Buy/OfferBeta/V1/Api/BiddingApi.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 placeProxyBidRequest has 76 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function placeProxyBidRequest($item_id, $x_ebay_c_marketplace_id, $place_proxy_bid_request = null)
        {
            // Verify the required parameter 'item_id' is set.
            if ($item_id === null || (\is_array($item_id) && count($item_id) === 0)) {
                throw new \InvalidArgumentException('Missing the required parameter $item_id when calling placeProxyBid');
    Severity: Major
    Found in src/Buy/OfferBeta/V1/Api/BiddingApi.php - About 3 hrs to fix

      Method getBiddingRequest has 70 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function getBiddingRequest($item_id, $x_ebay_c_marketplace_id)
          {
              // Verify the required parameter 'item_id' is set.
              if ($item_id === null || (\is_array($item_id) && count($item_id) === 0)) {
                  throw new \InvalidArgumentException('Missing the required parameter $item_id when calling getBidding');
      Severity: Major
      Found in src/Buy/OfferBeta/V1/Api/BiddingApi.php - About 2 hrs to fix

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

            public function getBiddingWithHttpInfo($item_id, $x_ebay_c_marketplace_id)
            {
                $request = $this->getBiddingRequest($item_id, $x_ebay_c_marketplace_id);
        
                try {
        Severity: Major
        Found in src/Buy/OfferBeta/V1/Api/BiddingApi.php - About 2 hrs to fix

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

              public function placeProxyBidWithHttpInfo($item_id, $x_ebay_c_marketplace_id, $place_proxy_bid_request = null)
              {
                  $request = $this->placeProxyBidRequest($item_id, $x_ebay_c_marketplace_id, $place_proxy_bid_request);
          
                  try {
          Severity: Major
          Found in src/Buy/OfferBeta/V1/Api/BiddingApi.php - About 2 hrs to fix

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

                public function placeProxyBidWithHttpInfo($item_id, $x_ebay_c_marketplace_id, $place_proxy_bid_request = null)
                {
                    $request = $this->placeProxyBidRequest($item_id, $x_ebay_c_marketplace_id, $place_proxy_bid_request);
            
                    try {
            Severity: Minor
            Found in src/Buy/OfferBeta/V1/Api/BiddingApi.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 getBiddingWithHttpInfo has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
            Open

                public function getBiddingWithHttpInfo($item_id, $x_ebay_c_marketplace_id)
                {
                    $request = $this->getBiddingRequest($item_id, $x_ebay_c_marketplace_id);
            
                    try {
            Severity: Minor
            Found in src/Buy/OfferBeta/V1/Api/BiddingApi.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

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

                public function placeProxyBidRequest($item_id, $x_ebay_c_marketplace_id, $place_proxy_bid_request = null)
                {
                    // Verify the required parameter 'item_id' is set.
                    if ($item_id === null || (\is_array($item_id) && count($item_id) === 0)) {
                        throw new \InvalidArgumentException('Missing the required parameter $item_id when calling placeProxyBid');
            Severity: Major
            Found in src/Buy/OfferBeta/V1/Api/BiddingApi.php and 5 other locations - About 3 days to fix
            src/Buy/Order/V2/Api/GuestCheckoutSessionApi.php on lines 323..421
            src/Buy/Order/V2/Api/GuestCheckoutSessionApi.php on lines 1116..1214
            src/Buy/Order/V2/Api/GuestCheckoutSessionApi.php on lines 1387..1485
            src/Buy/Order/V2/Api/GuestCheckoutSessionApi.php on lines 1658..1756
            src/Buy/Order/V2/Api/GuestCheckoutSessionApi.php on lines 1929..2027

            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 624.

            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 5 locations. Consider refactoring.
            Open

                public function getBiddingRequest($item_id, $x_ebay_c_marketplace_id)
                {
                    // Verify the required parameter 'item_id' is set.
                    if ($item_id === null || (\is_array($item_id) && count($item_id) === 0)) {
                        throw new \InvalidArgumentException('Missing the required parameter $item_id when calling getBidding');
            Severity: Major
            Found in src/Buy/OfferBeta/V1/Api/BiddingApi.php and 4 other locations - About 2 days to fix
            src/Buy/Deal/V1/Api/EventApi.php on lines 318..410
            src/Buy/Feed/V1/Api/FileApi.php on lines 607..699
            src/Buy/Order/V2/Api/GuestCheckoutSessionApi.php on lines 589..681
            src/Commerce/Charity/V1/Api/CharityOrgApi.php on lines 318..410

            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 562.

            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 8 locations. Consider refactoring.
            Open

                public function placeProxyBidWithHttpInfo($item_id, $x_ebay_c_marketplace_id, $place_proxy_bid_request = null)
                {
                    $request = $this->placeProxyBidRequest($item_id, $x_ebay_c_marketplace_id, $place_proxy_bid_request);
            
                    try {
            Severity: Major
            Found in src/Buy/OfferBeta/V1/Api/BiddingApi.php and 7 other locations - About 2 days to fix
            src/Buy/Browse/V1/Api/ItemApi.php on lines 183..248
            src/Buy/Order/V2/Api/GuestCheckoutSessionApi.php on lines 183..248
            src/Buy/Order/V2/Api/GuestCheckoutSessionApi.php on lines 976..1041
            src/Buy/Order/V2/Api/GuestCheckoutSessionApi.php on lines 1247..1312
            src/Buy/Order/V2/Api/GuestCheckoutSessionApi.php on lines 1518..1583
            src/Buy/Order/V2/Api/GuestCheckoutSessionApi.php on lines 1789..1854
            src/Sell/Marketing/V1/Api/AdGroupApi.php on lines 1287..1352

            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 539.

            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 9 locations. Consider refactoring.
            Open

                public function placeProxyBidAsyncWithHttpInfo($item_id, $x_ebay_c_marketplace_id, $place_proxy_bid_request = null)
                {
                    $returnType = '\TNT\Ebay\Buy\OfferBeta\V1\Model\PlaceProxyBidResponse';
                    $request = $this->placeProxyBidRequest($item_id, $x_ebay_c_marketplace_id, $place_proxy_bid_request);
            
            
            Severity: Major
            Found in src/Buy/OfferBeta/V1/Api/BiddingApi.php and 8 other locations - About 7 hrs to fix
            src/Buy/Browse/V1/Api/ItemApi.php on lines 282..310
            src/Buy/Feed/V1/Api/FileApi.php on lines 302..330
            src/Buy/Order/V2/Api/GuestCheckoutSessionApi.php on lines 282..310
            src/Buy/Order/V2/Api/GuestCheckoutSessionApi.php on lines 1075..1103
            src/Buy/Order/V2/Api/GuestCheckoutSessionApi.php on lines 1346..1374
            src/Buy/Order/V2/Api/GuestCheckoutSessionApi.php on lines 1617..1645
            src/Buy/Order/V2/Api/GuestCheckoutSessionApi.php on lines 1888..1916
            src/Sell/Marketing/V1/Api/AdGroupApi.php on lines 1386..1414

            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 243.

            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

            There are no issues that match your filters.

            Category
            Status