wikimedia/wikimedia-fundraising-SmashPig

View on GitHub

Showing 152 of 476 total issues

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

    public function testPaymentWithCompleteParamsPending(): void {
        $params = $this->getCreatePaymentRequestParams();
        $gateway_txn_id = "PAY2323243343543";
        $this->api->expects( $this->once() )
            ->method( 'cardAuthorizePayment' )
PaymentProviders/dlocal/Tests/phpunit/CardPaymentProviderTest.php on lines 44..81
PaymentProviders/dlocal/Tests/phpunit/CardPaymentProviderTest.php on lines 83..120

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

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 testCreatePaymentTruncateContactDetails() {
        $params = [
            'recurring' => true,
            'installment' => 'recurring',
            'recurring_payment_token' => '229a1d6e-1b26-4c91-8e00-969a49c9d041',
PaymentProviders/Ingenico/Tests/phpunit/PaymentProviderTest.php on lines 268..297

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

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 testCreatePaymentTruncateMultibyte() {
        $params = [
            'recurring' => true,
            'installment' => 'recurring',
            'recurring_payment_token' => '229a1d6e-1b26-4c91-8e00-969a49c9d041',
PaymentProviders/Ingenico/Tests/phpunit/PaymentProviderTest.php on lines 237..266

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

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 testRefundPaymentNotFoundError() {
        $gateway_txn_id = "dHJhbnNhY3Rpb25fYXIxMTNuZzQ";
        $request = [
            "gateway_txn_id" => $gateway_txn_id,
            "order_id" => '30.1',
PaymentProviders/Braintree/Tests/phpunit/PaymentProviderTest.php on lines 112..143

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

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 testRefundPaymentRefundedError() {
        $gateway_txn_id = "dHJhbnNhY3Rpb25fOHdrNzI0NXk";
        $request = [
            "gateway_txn_id" => $gateway_txn_id,
            "order_id" => '81.1',
PaymentProviders/Braintree/Tests/phpunit/PaymentProviderTest.php on lines 75..106

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

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 testCancelPaymentReturnsPaymentErrorWithMessagePaymentIdNotFound(): void {
        $gatewayTxnId = 'D-INVALID-5bc9c596-f3b6-4b7c-bf3c-432276030cd9';
        $apiError = [
            "code" => 4000,
            "message" => "Payment not found"
PaymentProviders/dlocal/Tests/phpunit/PaymentProviderTest.php on lines 461..485

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 testGetPaymentDetailReturnsPaymentErrorOnAPIException(): void {
        $gatewayTxnId = 'D-INVALID-5bc9c596-f3b6-4b7c-bf3c-432276030cd9';
        $apiError = [
            "code" => 4000,
            "message" => "Payment not found"
PaymentProviders/dlocal/Tests/phpunit/PaymentProviderTest.php on lines 197..221

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

    public function testPreabitrationLostSOAPMessageReceivedAndAcknowledged() {
        if ( !class_exists( \SoapServer::class ) ) {
            $this->markTestSkipped( 'Soap server disabled on CI' );
        }
        $request = $this->getMockBuilder( Request::class )->disableOriginalConstructor()
PaymentProviders/Adyen/Tests/phpunit/NotificationRequestTest.php on lines 428..447
PaymentProviders/Adyen/Tests/phpunit/NotificationRequestTest.php on lines 467..486
PaymentProviders/Adyen/Tests/phpunit/NotificationRequestTest.php on lines 506..525
PaymentProviders/Adyen/Tests/phpunit/NotificationRequestTest.php on lines 545..564
PaymentProviders/Adyen/Tests/phpunit/NotificationRequestTest.php on lines 623..642
PaymentProviders/Adyen/Tests/phpunit/NotificationRequestTest.php on lines 761..780

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

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

    public function testOrderClosedSOAPMessageReceivedAndAcknowledged() {
        if ( !class_exists( \SoapServer::class ) ) {
            $this->markTestSkipped( 'Soap server disabled on CI' );
        }
        $request = $this->getMockBuilder( Request::class )->disableOriginalConstructor()
PaymentProviders/Adyen/Tests/phpunit/NotificationRequestTest.php on lines 428..447
PaymentProviders/Adyen/Tests/phpunit/NotificationRequestTest.php on lines 467..486
PaymentProviders/Adyen/Tests/phpunit/NotificationRequestTest.php on lines 545..564
PaymentProviders/Adyen/Tests/phpunit/NotificationRequestTest.php on lines 584..603
PaymentProviders/Adyen/Tests/phpunit/NotificationRequestTest.php on lines 623..642
PaymentProviders/Adyen/Tests/phpunit/NotificationRequestTest.php on lines 761..780

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

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

    public function testNotificationOfChargebackSOAPMessageReceivedAndAcknowledged() {
        if ( !class_exists( \SoapServer::class ) ) {
            $this->markTestSkipped( 'Soap server disabled on CI' );
        }
        $request = $this->getMockBuilder( Request::class )->disableOriginalConstructor()
PaymentProviders/Adyen/Tests/phpunit/NotificationRequestTest.php on lines 467..486
PaymentProviders/Adyen/Tests/phpunit/NotificationRequestTest.php on lines 506..525
PaymentProviders/Adyen/Tests/phpunit/NotificationRequestTest.php on lines 545..564
PaymentProviders/Adyen/Tests/phpunit/NotificationRequestTest.php on lines 584..603
PaymentProviders/Adyen/Tests/phpunit/NotificationRequestTest.php on lines 623..642
PaymentProviders/Adyen/Tests/phpunit/NotificationRequestTest.php on lines 761..780

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

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

    public function testPreabitrationWonSOAPMessageReceivedAndAcknowledged() {
        if ( !class_exists( \SoapServer::class ) ) {
            $this->markTestSkipped( 'Soap server disabled on CI' );
        }
        $request = $this->getMockBuilder( Request::class )->disableOriginalConstructor()
PaymentProviders/Adyen/Tests/phpunit/NotificationRequestTest.php on lines 428..447
PaymentProviders/Adyen/Tests/phpunit/NotificationRequestTest.php on lines 467..486
PaymentProviders/Adyen/Tests/phpunit/NotificationRequestTest.php on lines 506..525
PaymentProviders/Adyen/Tests/phpunit/NotificationRequestTest.php on lines 545..564
PaymentProviders/Adyen/Tests/phpunit/NotificationRequestTest.php on lines 584..603
PaymentProviders/Adyen/Tests/phpunit/NotificationRequestTest.php on lines 761..780

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

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

    public function testOrderOpenedSOAPMessageReceivedAndAcknowledged() {
        if ( !class_exists( \SoapServer::class ) ) {
            $this->markTestSkipped( 'Soap server disabled on CI' );
        }
        $request = $this->getMockBuilder( Request::class )->disableOriginalConstructor()
PaymentProviders/Adyen/Tests/phpunit/NotificationRequestTest.php on lines 428..447
PaymentProviders/Adyen/Tests/phpunit/NotificationRequestTest.php on lines 467..486
PaymentProviders/Adyen/Tests/phpunit/NotificationRequestTest.php on lines 506..525
PaymentProviders/Adyen/Tests/phpunit/NotificationRequestTest.php on lines 584..603
PaymentProviders/Adyen/Tests/phpunit/NotificationRequestTest.php on lines 623..642
PaymentProviders/Adyen/Tests/phpunit/NotificationRequestTest.php on lines 761..780

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

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

    public function testRefundedReversedSOAPMessageReceivedAndAcknowledged() {
        if ( !class_exists( \SoapServer::class ) ) {
            $this->markTestSkipped( 'Soap server disabled on CI' );
        }
        $request = $this->getMockBuilder( Request::class )->disableOriginalConstructor()
PaymentProviders/Adyen/Tests/phpunit/NotificationRequestTest.php on lines 428..447
PaymentProviders/Adyen/Tests/phpunit/NotificationRequestTest.php on lines 467..486
PaymentProviders/Adyen/Tests/phpunit/NotificationRequestTest.php on lines 506..525
PaymentProviders/Adyen/Tests/phpunit/NotificationRequestTest.php on lines 545..564
PaymentProviders/Adyen/Tests/phpunit/NotificationRequestTest.php on lines 584..603
PaymentProviders/Adyen/Tests/phpunit/NotificationRequestTest.php on lines 623..642

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

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

    public function testNotificationOfFraudSOAPMessageReceivedAndAcknowledged() {
        if ( !class_exists( \SoapServer::class ) ) {
            $this->markTestSkipped( 'Soap server disabled on CI' );
        }
        $request = $this->getMockBuilder( Request::class )->disableOriginalConstructor()
PaymentProviders/Adyen/Tests/phpunit/NotificationRequestTest.php on lines 428..447
PaymentProviders/Adyen/Tests/phpunit/NotificationRequestTest.php on lines 506..525
PaymentProviders/Adyen/Tests/phpunit/NotificationRequestTest.php on lines 545..564
PaymentProviders/Adyen/Tests/phpunit/NotificationRequestTest.php on lines 584..603
PaymentProviders/Adyen/Tests/phpunit/NotificationRequestTest.php on lines 623..642
PaymentProviders/Adyen/Tests/phpunit/NotificationRequestTest.php on lines 761..780

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

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 static $errorCodes = [
        '3001' => ErrorCode::ACCOUNT_MISCONFIGURATION, // Invalid Credentials.
        '3002' => ErrorCode::UNKNOWN, // Unregistered IP address.
        '3003' => ErrorCode::BAD_SIGNATURE, // Merchant has no authorization to use this API.
        '4000' => ErrorCode::TRANSACTION_NOT_FOUND, // Payment not found.
Severity: Major
Found in PaymentProviders/dlocal/ErrorMapper.php and 1 other location - About 5 hrs to fix
PaymentProviders/Ingenico/PaymentProvider.php on lines 340..366

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

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

        $errorMap = [
            '20000000' => ErrorCode::MISSING_REQUIRED_DATA,
            // TODO: handle 400120 which is ErrorCode::DUPLICATE_ORDER_ID when the TXN is INSERT_ORDERWITHPAYMENT
            '400490' => ErrorCode::DUPLICATE_ORDER_ID,
            '300620' => ErrorCode::DUPLICATE_ORDER_ID,
Severity: Major
Found in PaymentProviders/Ingenico/PaymentProvider.php and 1 other location - About 5 hrs to fix
PaymentProviders/dlocal/ErrorMapper.php on lines 38..63

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

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 searchRefunds( array $input, ?string $after ): array {
        $response = $this->api->searchRefunds( $input, $after );
        if ( isset( $response['errors'] ) ) {
            return $response['errors'];
        }
Severity: Major
Found in PaymentProviders/Braintree/SearchTransactionsProvider.php and 1 other location - About 5 hrs to fix
PaymentProviders/Braintree/SearchTransactionsProvider.php on lines 56..69

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

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 searchDisputes( array $input, ?string $after ): array {
        $response = $this->api->searchDisputes( $input, $after );
        if ( isset( $response['errors'] ) ) {
            return $response['errors'];
        }
Severity: Major
Found in PaymentProviders/Braintree/SearchTransactionsProvider.php and 1 other location - About 5 hrs to fix
PaymentProviders/Braintree/SearchTransactionsProvider.php on lines 36..49

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

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 testSuccessfulRefund() {
        $refund = new Refund();
        $refund->merchantAccountCode = 'WikimediaTest';
        $refund->currency = 'USD';
        $refund->amount = 10.00;
PaymentProviders/Adyen/Tests/phpunit/ChargebackInitiatedActionTest.php on lines 26..44

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

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 testSuccessfulChargeback() {
        $chargeback = new Chargeback();
        $chargeback->merchantAccountCode = 'WikimediaTest';
        $chargeback->currency = 'USD';
        $chargeback->amount = 10.00;
PaymentProviders/Adyen/Tests/phpunit/RefundInitiatedActionTest.php on lines 25..43

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

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

Severity
Category
Status
Source
Language