wikimedia/wikimedia-fundraising-SmashPig

View on GitHub

Showing 152 of 476 total issues

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

    public function createGooglePayPayment( $params ) {
        $restParams = [
            'amount' => $this->getArrayAmount( $params ),
            'reference' => $params['order_id'],
            'merchantAccount' => $this->account,
Severity: Major
Found in PaymentProviders/Adyen/Api.php and 1 other location - About 4 hrs to fix
PaymentProviders/Adyen/Api.php on lines 360..386

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

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 createApplePayPayment( $params ) {
        $restParams = [
            'amount' => $this->getArrayAmount( $params ),
            'reference' => $params['order_id'],
            'merchantAccount' => $this->account,
Severity: Major
Found in PaymentProviders/Adyen/Api.php and 1 other location - About 4 hrs to fix
PaymentProviders/Adyen/Api.php on lines 332..358

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

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

    public function testRequestForInformationSOAPMessageReceivedAndAcknowledged() {
        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 93..110
PaymentProviders/Adyen/Tests/phpunit/NotificationRequestTest.php on lines 183..201
PaymentProviders/Adyen/Tests/phpunit/NotificationRequestTest.php on lines 220..238
PaymentProviders/Adyen/Tests/phpunit/NotificationRequestTest.php on lines 307..325
PaymentProviders/Adyen/Tests/phpunit/NotificationRequestTest.php on lines 393..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 172.

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

    public function testCaptureFailedSOAPMessageReceivedAndAcknowledged() {
        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 93..110
PaymentProviders/Adyen/Tests/phpunit/NotificationRequestTest.php on lines 183..201
PaymentProviders/Adyen/Tests/phpunit/NotificationRequestTest.php on lines 220..238
PaymentProviders/Adyen/Tests/phpunit/NotificationRequestTest.php on lines 393..410
PaymentProviders/Adyen/Tests/phpunit/NotificationRequestTest.php on lines 848..866

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

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

    public function testSOAPAuthorisationRecurringMessageReceivedAndAcknowledged() {
        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 183..201
PaymentProviders/Adyen/Tests/phpunit/NotificationRequestTest.php on lines 220..238
PaymentProviders/Adyen/Tests/phpunit/NotificationRequestTest.php on lines 307..325
PaymentProviders/Adyen/Tests/phpunit/NotificationRequestTest.php on lines 393..410
PaymentProviders/Adyen/Tests/phpunit/NotificationRequestTest.php on lines 848..866

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

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

    public function testChargeBackReversedSOAPMessageReceivedAndAcknowledged() {
        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 93..110
PaymentProviders/Adyen/Tests/phpunit/NotificationRequestTest.php on lines 183..201
PaymentProviders/Adyen/Tests/phpunit/NotificationRequestTest.php on lines 220..238
PaymentProviders/Adyen/Tests/phpunit/NotificationRequestTest.php on lines 307..325
PaymentProviders/Adyen/Tests/phpunit/NotificationRequestTest.php on lines 848..866

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

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

    public function testCancelAutoRescueSoapMessageReceivedAndAcknowledged() {
        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 93..110
PaymentProviders/Adyen/Tests/phpunit/NotificationRequestTest.php on lines 220..238
PaymentProviders/Adyen/Tests/phpunit/NotificationRequestTest.php on lines 307..325
PaymentProviders/Adyen/Tests/phpunit/NotificationRequestTest.php on lines 393..410
PaymentProviders/Adyen/Tests/phpunit/NotificationRequestTest.php on lines 848..866

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

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

    public function testCancellationMessageReceivedAndAcknowledged() {
        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 93..110
PaymentProviders/Adyen/Tests/phpunit/NotificationRequestTest.php on lines 183..201
PaymentProviders/Adyen/Tests/phpunit/NotificationRequestTest.php on lines 307..325
PaymentProviders/Adyen/Tests/phpunit/NotificationRequestTest.php on lines 393..410
PaymentProviders/Adyen/Tests/phpunit/NotificationRequestTest.php on lines 848..866

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

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 cancelPayment( $gatewayTxnId ): CancelPaymentResponse {
        $rawResponse = $this->api->cancel( $gatewayTxnId );
        $response = new CancelPaymentResponse();
        $response->setRawResponse( $rawResponse );

Severity: Major
Found in PaymentProviders/Adyen/PaymentProvider.php and 2 other locations - About 4 hrs to fix
PaymentProviders/Adyen/PaymentProvider.php on lines 236..261
PaymentProviders/Adyen/PaymentProvider.php on lines 270..295

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

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

<?php

namespace SmashPig\PaymentProviders\Adyen\Maintenance;

require __DIR__ . '/../../../Maintenance/MaintenanceBase.php';
Severity: Major
Found in PaymentProviders/Adyen/Maintenance/TestGetPaymentToken.php and 1 other location - About 4 hrs to fix
PaymentProviders/Adyen/Maintenance/CancelPayment.php on lines 1..41

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

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

<?php

namespace SmashPig\PaymentProviders\Adyen\Maintenance;

require __DIR__ . '/../../../Maintenance/MaintenanceBase.php';
Severity: Major
Found in PaymentProviders/Adyen/Maintenance/CancelPayment.php and 1 other location - About 4 hrs to fix
PaymentProviders/Adyen/Maintenance/TestGetPaymentToken.php on lines 1..41

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

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 refundPayment( array $params ): RefundPaymentResponse {
        $rawResponse = $this->api->refundPayment( $params );
        $response = new RefundPaymentResponse();
        $response->setRawResponse( $rawResponse );

Severity: Major
Found in PaymentProviders/Adyen/PaymentProvider.php and 2 other locations - About 4 hrs to fix
PaymentProviders/Adyen/PaymentProvider.php on lines 236..261
PaymentProviders/Adyen/PaymentProvider.php on lines 304..335

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

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 approvePayment( array $params ): ApprovePaymentResponse {
        $rawResponse = $this->api->approvePayment( $params );
        $response = new ApprovePaymentResponse();
        $response->setRawResponse( $rawResponse );

Severity: Major
Found in PaymentProviders/Adyen/PaymentProvider.php and 2 other locations - About 4 hrs to fix
PaymentProviders/Adyen/PaymentProvider.php on lines 270..295
PaymentProviders/Adyen/PaymentProvider.php on lines 304..335

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

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 testNotificationOfChargebackJSONMessageReceivedAndAcknowledged() {
        $request = $this->getMockBuilder( Request::class )->disableOriginalConstructor()
        ->getMock();
        $response = $this->getMockBuilder( Response::class )->disableOriginalConstructor()
        ->getMock();
PaymentProviders/Adyen/Tests/phpunit/NotificationRequestTest.php on lines 488..504
PaymentProviders/Adyen/Tests/phpunit/NotificationRequestTest.php on lines 527..543
PaymentProviders/Adyen/Tests/phpunit/NotificationRequestTest.php on lines 566..582
PaymentProviders/Adyen/Tests/phpunit/NotificationRequestTest.php on lines 605..621
PaymentProviders/Adyen/Tests/phpunit/NotificationRequestTest.php on lines 644..660
PaymentProviders/Adyen/Tests/phpunit/NotificationRequestTest.php on lines 782..798

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

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 testRefundedReversedJSONMessageReceivedAndAcknowledged() {
        $request = $this->getMockBuilder( Request::class )->disableOriginalConstructor()
        ->getMock();
        $response = $this->getMockBuilder( Response::class )->disableOriginalConstructor()
        ->getMock();
PaymentProviders/Adyen/Tests/phpunit/NotificationRequestTest.php on lines 449..465
PaymentProviders/Adyen/Tests/phpunit/NotificationRequestTest.php on lines 488..504
PaymentProviders/Adyen/Tests/phpunit/NotificationRequestTest.php on lines 527..543
PaymentProviders/Adyen/Tests/phpunit/NotificationRequestTest.php on lines 566..582
PaymentProviders/Adyen/Tests/phpunit/NotificationRequestTest.php on lines 605..621
PaymentProviders/Adyen/Tests/phpunit/NotificationRequestTest.php on lines 644..660

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

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 testGetPaymentStatusPending(): void {
        $gatewayTxnId = "D-2486-5bc9c596-f3b6-4b7c-bf3c-432276030cd9";

        $mockResponse = $this->prepareMockResponse( 'get-payment-status-pending.response', 200 );
        $this->curlWrapper->expects( $this->once() )
Severity: Major
Found in PaymentProviders/dlocal/Tests/phpunit/ApiTest.php and 2 other locations - About 4 hrs to fix
PaymentProviders/dlocal/Tests/phpunit/ApiTest.php on lines 589..607
PaymentProviders/dlocal/Tests/phpunit/ApiTest.php on lines 627..645

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

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 testNotificationOfFraudJSONMessageReceivedAndAcknowledged() {
        $request = $this->getMockBuilder( Request::class )->disableOriginalConstructor()
        ->getMock();
        $response = $this->getMockBuilder( Response::class )->disableOriginalConstructor()
        ->getMock();
PaymentProviders/Adyen/Tests/phpunit/NotificationRequestTest.php on lines 449..465
PaymentProviders/Adyen/Tests/phpunit/NotificationRequestTest.php on lines 527..543
PaymentProviders/Adyen/Tests/phpunit/NotificationRequestTest.php on lines 566..582
PaymentProviders/Adyen/Tests/phpunit/NotificationRequestTest.php on lines 605..621
PaymentProviders/Adyen/Tests/phpunit/NotificationRequestTest.php on lines 644..660
PaymentProviders/Adyen/Tests/phpunit/NotificationRequestTest.php on lines 782..798

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

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 testtPreabitrationLostJSONMessageReceivedAndAcknowledged() {
        $request = $this->getMockBuilder( Request::class )->disableOriginalConstructor()
        ->getMock();
        $response = $this->getMockBuilder( Response::class )->disableOriginalConstructor()
        ->getMock();
PaymentProviders/Adyen/Tests/phpunit/NotificationRequestTest.php on lines 449..465
PaymentProviders/Adyen/Tests/phpunit/NotificationRequestTest.php on lines 488..504
PaymentProviders/Adyen/Tests/phpunit/NotificationRequestTest.php on lines 527..543
PaymentProviders/Adyen/Tests/phpunit/NotificationRequestTest.php on lines 566..582
PaymentProviders/Adyen/Tests/phpunit/NotificationRequestTest.php on lines 644..660
PaymentProviders/Adyen/Tests/phpunit/NotificationRequestTest.php on lines 782..798

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

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 testPreabitrationWonJSONMessageReceivedAndAcknowledged() {
        $request = $this->getMockBuilder( Request::class )->disableOriginalConstructor()
        ->getMock();
        $response = $this->getMockBuilder( Response::class )->disableOriginalConstructor()
        ->getMock();
PaymentProviders/Adyen/Tests/phpunit/NotificationRequestTest.php on lines 449..465
PaymentProviders/Adyen/Tests/phpunit/NotificationRequestTest.php on lines 488..504
PaymentProviders/Adyen/Tests/phpunit/NotificationRequestTest.php on lines 527..543
PaymentProviders/Adyen/Tests/phpunit/NotificationRequestTest.php on lines 566..582
PaymentProviders/Adyen/Tests/phpunit/NotificationRequestTest.php on lines 605..621
PaymentProviders/Adyen/Tests/phpunit/NotificationRequestTest.php on lines 782..798

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

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 testGetPaymentStatusPaid(): void {
        $gatewayTxnId = "D-2486-5bc9c596-f3b6-4b7c-bf3c-432276030cd9";

        $mockResponse = $this->prepareMockResponse( 'get-payment-status-paid.response', 200 );
        $this->curlWrapper->expects( $this->once() )
Severity: Major
Found in PaymentProviders/dlocal/Tests/phpunit/ApiTest.php and 2 other locations - About 4 hrs to fix
PaymentProviders/dlocal/Tests/phpunit/ApiTest.php on lines 569..587
PaymentProviders/dlocal/Tests/phpunit/ApiTest.php on lines 627..645

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

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