adyen_gateway/adyen_submit_payment.api.php
Method execute
has 78 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function execute() {
if ( RequestContext::getMain()->getUser()->pingLimiter( 'submitpayment' ) ) {
// Allow rate limiting by setting e.g. $wgRateLimits['submitpayment']['ip']
return;
}
File adyen_submit_payment.api.php
has 251 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
<?php
use SmashPig\Core\DataStores\QueueWrapper;
use SmashPig\Core\SequenceGenerators;
use SmashPig\Core\UtcDate;
use SmashPig\PaymentData\FinalStatus;
Method sendToDonations
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected function sendToDonations() {
$message = [
'contribution_tracking_id' => $this->contributionTrackingId,
'date' => UtcDate::getUtcTimestamp(),
'gateway' => $this->gateway,
Function execute
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
Open
public function execute() {
if ( RequestContext::getMain()->getUser()->pingLimiter( 'submitpayment' ) ) {
// Allow rate limiting by setting e.g. $wgRateLimits['submitpayment']['ip']
return;
}
- 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
Method sendToContributionTracking
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected function sendToContributionTracking() {
// build utm key, looks like pay the fee is still taken from that
if ( $this->donationData['pay_the_fee'] === 1 ) {
$this->donationData['utm_key'] = 'ptf_1';
}
Avoid too many return
statements within this method. Open
Open
return '';
Avoid too many return
statements within this method. Open
Open
return;
Avoid too many return
statements within this method. Open
Open
return;