Showing 476 of 476 total issues
Function getPayerInfo
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function getPayerInfo( array $row, string $info, bool $isChargeBack = false ) : ?string {
if ( !$isChargeBack && $row['paymentMethodSnapshot'] ) {
$payerBlock = $row['paymentMethodSnapshot'];
} elseif ( $isChargeBack && $row['transaction']['paymentMethodSnapshot'] ) {
$payerBlock = $row['transaction']['paymentMethodSnapshot'];
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function execute
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function execute() {
$logger = Logger::getTaggedLogger( "corr_id-adyen-{$this->merchantReference}" );
$logger->info(
"Recording successful capture on account '{$this->account}' with authorization reference " .
"'{$this->gatewayTxnId}' and order ID '{$this->merchantReference}'."
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function refundPayment
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function refundPayment( array $params ): RefundPaymentResponse {
try {
if ( empty( $params['gateway_txn_id'] ) ) {
return DlocalRefundPaymentResponseFactory::fromErrorResponse( [
'error' => 'Missing required fields'
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function createPayment
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function createPayment( array $params ): CreatePaymentResponse {
// re-fetch email info for venmo
if ( !empty( $params['gateway_session_id'] ) && empty( $params['email'] ) ) {
Logger::info( 'No email passed, fetch again with gateway_session_id: ' . $params['gateway_session_id'] );
$donorDetails = $this->fetchCustomerData( $params['gateway_session_id'] );
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function shouldRetry
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function shouldRetry( array $parsedResponse ): bool {
if ( $parsedResponse['status'] === Response::HTTP_FORBIDDEN ) {
$body = $parsedResponse['body'];
Logger::warning( "Request returned (403) FORBIDDEN: $body" );
return false;
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function throwOnAdyenError
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public static function throwOnAdyenError( $adyenResponse ) {
$exceptionCode = null;
$exceptionMessage = null;
if ( $adyenResponse === null ) {
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function loadConfigFromPaths
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function loadConfigFromPaths( array $searchPath ) {
$paths = $this->expandSearchPathToActual( $searchPath );
// Reset to empty set.
$this->options = [];
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function approvePayment
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function approvePayment( array $params ): ApprovePaymentResponse {
$rawResponse = $this->api->doExpressCheckoutPayment( $params );
$response = new ApprovePaymentResponse();
$response->setRawResponse( $rawResponse );
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function parseRefund
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected function parseRefund( DOMElement $recordNode, string $type, string $gateway ): array {
$record = $this->xmlToArray( $recordNode, $this->refundMap );
$record['type'] = $type;
// deal with negative EffortID
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function getNext
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function getNext() {
if ( !$this->connection ) {
$this->connect();
}
$this->connection->beginTransaction();
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function is_reject
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function is_reject() {
foreach ( $this->providerConfiguration->val( 'rejects' ) as $key => $val ) {
if ( isset( $this->payload->{$key} ) ) {
$values = (array)$val;
if ( in_array( $this->payload->{$key}, $values, true ) ) {
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function deleteDataForPayment
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function deleteDataForPayment( string $gatewayTransactionId ): DeleteDataResponse {
$rawResponse = $this->api->deleteDataForPayment( $gatewayTransactionId );
$response = new DeleteDataResponse();
$response->setRawResponse( $rawResponse );
if ( !isset( $rawResponse['result'] ) ) {
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function execute
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function execute() {
/**
* @var PaymentProvider
*/
$adyen = PaymentProviderFactory::getProviderForMethod( $this->getOption( 'method' ) );
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function normalizeMessage
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public static function normalizeMessage( &$message, $ipnMessage ) {
if (
$ipnMessage['txn_type'] === 'express_checkout' ||
(
$ipnMessage['txn_type'] === 'cart' &&
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function setBody
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function setBody( $data ): OutboundRequest {
if ( is_array( $data ) ) {
$this->body = http_build_query( $data );
} else {
$this->body = $data;
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function getOriginalDateOrDefault
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public static function getOriginalDateOrDefault( $message, $default = 0 ) {
// This is the actual queued time
if ( isset( $message['source_enqueued_time'] ) ) {
// This is only ever set to the numeric timestamp
return $message['source_enqueued_time'];
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"