PromisePay/promisepay-php

View on GitHub
lib/ItemRepository.php

Summary

Maintainability
F
1 wk
Test Coverage

File ItemRepository.php has 412 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
namespace PromisePay;

use PromisePay\DataObjects\BPayDetails;
use PromisePay\DataObjects\Fee;
Severity: Minor
Found in lib/ItemRepository.php - About 5 hrs to fix

    ItemRepository has 22 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class ItemRepository extends ApiAbstract
    {
        public function getListOfItems($limit = 20, $offset = 0)
        {
            $this->paramsListCorrect($limit,$offset);
    Severity: Minor
    Found in lib/ItemRepository.php - About 2 hrs to fix

      Method updateItem has 32 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function updateItem(Item $item, $user = null, $account = null, $releaseAmount = null)
          {
              $payload = '';
              $preparePayload = array(
                 'id'=>$item->getId(),
      Severity: Minor
      Found in lib/ItemRepository.php - About 1 hr to fix

        Method createItem has 30 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function createItem(Item $item)
            {
                $payload = '';
                $preparePayload = array(
                    "id"            => $item->getId(),
        Severity: Minor
        Found in lib/ItemRepository.php - About 1 hr to fix

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

              public function requestRefund( $itemId,  $refundAmount,  $refundMessage)
              {
                  $this->checkIdNotNull($itemId);
                  $this->checkIdNotNull($refundAmount);
                  $this->checkIdNotNull($refundMessage);
          Severity: Major
          Found in lib/ItemRepository.php and 1 other location - About 7 hrs to fix
          lib/ItemRepository.php on lines 427..456

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

          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 refund( $itemId,  $refundAmount,  $refundMessage)
              {
                  $this->checkIdNotNull($itemId);
                  $this->checkIdNotNull($refundAmount);
                  $this->checkIdNotNull($refundMessage);
          Severity: Major
          Found in lib/ItemRepository.php and 1 other location - About 7 hrs to fix
          lib/ItemRepository.php on lines 396..425

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

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

              public function releasePayment($itemId, $releaseAmount)
              {
                  $this->checkIdNotNull($itemId);
                  $this->checkIdNotNull($releaseAmount);
          
          
          Severity: Major
          Found in lib/ItemRepository.php and 2 other locations - About 6 hrs to fix
          lib/ItemRepository.php on lines 238..264
          lib/ItemRepository.php on lines 310..337

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

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

              public function makePayment($itemId, $accountId)
              {
                  $this->checkIdNotNull($itemId);
                  $this->checkIdNotNull($accountId);
          
          
          Severity: Major
          Found in lib/ItemRepository.php and 2 other locations - About 6 hrs to fix
          lib/ItemRepository.php on lines 281..308
          lib/ItemRepository.php on lines 310..337

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

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

              public function requestRelease($itemId, $releaseAmount)
              {
                  $this->checkIdNotNull($itemId);
                  $this->checkIdNotNull($releaseAmount);
          
          
          Severity: Major
          Found in lib/ItemRepository.php and 2 other locations - About 6 hrs to fix
          lib/ItemRepository.php on lines 238..264
          lib/ItemRepository.php on lines 281..308

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

          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 getListOfTransactionsForItem($id)
              {
                  $this->checkIdNotNull($id);
                  $response = $this->RestClient('get', 'items/' . $id . '/transactions');
                  $jsonRaw = json_decode($response->raw_body, true);
          Severity: Major
          Found in lib/ItemRepository.php and 1 other location - About 2 hrs to fix
          lib/ItemRepository.php on lines 164..180

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

          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 getListFeesForItems($id)
              {
                  $this->checkIdNotNull($id);
                  $response = $this->RestClient('get', 'items/' . $id . '/fees');
                  $jsonRaw = json_decode($response->raw_body, true);
          Severity: Major
          Found in lib/ItemRepository.php and 1 other location - About 2 hrs to fix
          lib/ItemRepository.php on lines 132..148

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

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

              public function cancelItem($itemId)
              {
                  $this->checkIdNotNull($itemId);
                  $response = $this->RestClient('patch', 'items/' . $itemId . '/cancel');
                  $jsonRaw = json_decode($response->raw_body, true);
          Severity: Major
          Found in lib/ItemRepository.php and 13 other locations - About 1 hr to fix
          lib/BankAccountRepository.php on lines 63..75
          lib/CardAccountRepository.php on lines 58..70
          lib/ItemRepository.php on lines 150..162
          lib/ItemRepository.php on lines 182..194
          lib/ItemRepository.php on lines 196..208
          lib/ItemRepository.php on lines 210..222
          lib/ItemRepository.php on lines 224..236
          lib/ItemRepository.php on lines 266..279
          lib/ItemRepository.php on lines 353..366
          lib/ItemRepository.php on lines 368..381
          lib/PayPalAccountRepository.php on lines 49..61
          lib/UploadRepository.php on lines 55..68
          lib/UploadRepository.php on lines 70..84

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

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

              public function requestPayment($itemId)
              {
                  $this->checkIdNotNull($itemId);
          
                  $response = $this->RestClient('patch', 'items/' . $itemId . '/request_payment');
          Severity: Major
          Found in lib/ItemRepository.php and 13 other locations - About 1 hr to fix
          lib/BankAccountRepository.php on lines 63..75
          lib/CardAccountRepository.php on lines 58..70
          lib/ItemRepository.php on lines 150..162
          lib/ItemRepository.php on lines 182..194
          lib/ItemRepository.php on lines 196..208
          lib/ItemRepository.php on lines 210..222
          lib/ItemRepository.php on lines 224..236
          lib/ItemRepository.php on lines 339..351
          lib/ItemRepository.php on lines 353..366
          lib/ItemRepository.php on lines 368..381
          lib/PayPalAccountRepository.php on lines 49..61
          lib/UploadRepository.php on lines 55..68
          lib/UploadRepository.php on lines 70..84

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

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

              public function getBuyerOfItem($id)
              {
                  $this->checkIdNotNull($id);
                  $response = $this->RestClient('get', 'items/' . $id . '/buyers');
                  $jsonRaw = json_decode($response->raw_body, true);
          Severity: Major
          Found in lib/ItemRepository.php and 13 other locations - About 1 hr to fix
          lib/BankAccountRepository.php on lines 63..75
          lib/CardAccountRepository.php on lines 58..70
          lib/ItemRepository.php on lines 150..162
          lib/ItemRepository.php on lines 196..208
          lib/ItemRepository.php on lines 210..222
          lib/ItemRepository.php on lines 224..236
          lib/ItemRepository.php on lines 266..279
          lib/ItemRepository.php on lines 339..351
          lib/ItemRepository.php on lines 353..366
          lib/ItemRepository.php on lines 368..381
          lib/PayPalAccountRepository.php on lines 49..61
          lib/UploadRepository.php on lines 55..68
          lib/UploadRepository.php on lines 70..84

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

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

              public function getSellerForItem($id)
              {
                  $this->checkIdNotNull($id);
                  $response = $this->RestClient('get', 'items/' . $id . '/sellers');
                  $jsonRaw = json_decode($response->raw_body, true);
          Severity: Major
          Found in lib/ItemRepository.php and 13 other locations - About 1 hr to fix
          lib/BankAccountRepository.php on lines 63..75
          lib/CardAccountRepository.php on lines 58..70
          lib/ItemRepository.php on lines 150..162
          lib/ItemRepository.php on lines 182..194
          lib/ItemRepository.php on lines 210..222
          lib/ItemRepository.php on lines 224..236
          lib/ItemRepository.php on lines 266..279
          lib/ItemRepository.php on lines 339..351
          lib/ItemRepository.php on lines 353..366
          lib/ItemRepository.php on lines 368..381
          lib/PayPalAccountRepository.php on lines 49..61
          lib/UploadRepository.php on lines 55..68
          lib/UploadRepository.php on lines 70..84

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

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

              public function getWireDetailsForItem($id)
              {
                  $this->checkIdNotNull($id);
                  $response = $this->RestClient('get', 'items/' . $id . '/wire_details');
                  $jsonRaw = json_decode($response->raw_body, true);
          Severity: Major
          Found in lib/ItemRepository.php and 13 other locations - About 1 hr to fix
          lib/BankAccountRepository.php on lines 63..75
          lib/CardAccountRepository.php on lines 58..70
          lib/ItemRepository.php on lines 150..162
          lib/ItemRepository.php on lines 182..194
          lib/ItemRepository.php on lines 196..208
          lib/ItemRepository.php on lines 224..236
          lib/ItemRepository.php on lines 266..279
          lib/ItemRepository.php on lines 339..351
          lib/ItemRepository.php on lines 353..366
          lib/ItemRepository.php on lines 368..381
          lib/PayPalAccountRepository.php on lines 49..61
          lib/UploadRepository.php on lines 55..68
          lib/UploadRepository.php on lines 70..84

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

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

              public function acknowledgePayPal($itemId)
              {
                  $this->checkIdNotNull($itemId);
          
                  $response = $this->RestClient('patch', 'items/' . $itemId . '/acknowledge_paypal');
          Severity: Major
          Found in lib/ItemRepository.php and 13 other locations - About 1 hr to fix
          lib/BankAccountRepository.php on lines 63..75
          lib/CardAccountRepository.php on lines 58..70
          lib/ItemRepository.php on lines 150..162
          lib/ItemRepository.php on lines 182..194
          lib/ItemRepository.php on lines 196..208
          lib/ItemRepository.php on lines 210..222
          lib/ItemRepository.php on lines 224..236
          lib/ItemRepository.php on lines 266..279
          lib/ItemRepository.php on lines 339..351
          lib/ItemRepository.php on lines 353..366
          lib/PayPalAccountRepository.php on lines 49..61
          lib/UploadRepository.php on lines 55..68
          lib/UploadRepository.php on lines 70..84

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

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

              public function getItemStatus($id)
              {
                  $this->checkIdNotNull($id);
                  $response = $this->RestClient('get', 'items/' . $id . '/status');
                  $jsonRaw = json_decode($response->raw_body, true);
          Severity: Major
          Found in lib/ItemRepository.php and 13 other locations - About 1 hr to fix
          lib/BankAccountRepository.php on lines 63..75
          lib/CardAccountRepository.php on lines 58..70
          lib/ItemRepository.php on lines 182..194
          lib/ItemRepository.php on lines 196..208
          lib/ItemRepository.php on lines 210..222
          lib/ItemRepository.php on lines 224..236
          lib/ItemRepository.php on lines 266..279
          lib/ItemRepository.php on lines 339..351
          lib/ItemRepository.php on lines 353..366
          lib/ItemRepository.php on lines 368..381
          lib/PayPalAccountRepository.php on lines 49..61
          lib/UploadRepository.php on lines 55..68
          lib/UploadRepository.php on lines 70..84

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

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

              public function getBPayDetailsForItem($id)
              {
                  $this->checkIdNotNull($id);
                  $response = $this->RestClient('get', 'items/' . $id . '/bpay_details');
                  $jsonRaw = json_decode($response->raw_body, true);
          Severity: Major
          Found in lib/ItemRepository.php and 13 other locations - About 1 hr to fix
          lib/BankAccountRepository.php on lines 63..75
          lib/CardAccountRepository.php on lines 58..70
          lib/ItemRepository.php on lines 150..162
          lib/ItemRepository.php on lines 182..194
          lib/ItemRepository.php on lines 196..208
          lib/ItemRepository.php on lines 210..222
          lib/ItemRepository.php on lines 266..279
          lib/ItemRepository.php on lines 339..351
          lib/ItemRepository.php on lines 353..366
          lib/ItemRepository.php on lines 368..381
          lib/PayPalAccountRepository.php on lines 49..61
          lib/UploadRepository.php on lines 55..68
          lib/UploadRepository.php on lines 70..84

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

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

              public function acknowledgeWire($itemId)
              {
                  $this->checkIdNotNull($itemId);
          
                  $response = $this->RestClient('patch', 'items/' . $itemId . '/acknowledge_wire');
          Severity: Major
          Found in lib/ItemRepository.php and 13 other locations - About 1 hr to fix
          lib/BankAccountRepository.php on lines 63..75
          lib/CardAccountRepository.php on lines 58..70
          lib/ItemRepository.php on lines 150..162
          lib/ItemRepository.php on lines 182..194
          lib/ItemRepository.php on lines 196..208
          lib/ItemRepository.php on lines 210..222
          lib/ItemRepository.php on lines 224..236
          lib/ItemRepository.php on lines 266..279
          lib/ItemRepository.php on lines 339..351
          lib/ItemRepository.php on lines 368..381
          lib/PayPalAccountRepository.php on lines 49..61
          lib/UploadRepository.php on lines 55..68
          lib/UploadRepository.php on lines 70..84

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

          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