Showing 275 of 311 total issues
Avoid too many return
statements within this method. Open
return $this->captureOneTimePayment( $provider );
Avoid too many return
statements within this method. Open
return PaymentResult::fromResults(
new PaymentTransactionResponse(),
$this->getFinalStatus()
);
Avoid too many return
statements within this method. Open
return;
Avoid too many return
statements within this method. Open
return;
Avoid too many return
statements within this method. Open
return !is_array( $value );
Avoid too many return
statements within this method. Open
return false;
Avoid too many return
statements within this method. Open
return false;
Avoid too many return
statements within this method. Open
return $employerList;
Avoid too many return
statements within this method. Open
return;
Avoid too many return
statements within this method. Open
return true;
Avoid too many return
statements within this method. Open
return;
Avoid too many return
statements within this method. Open
return !$isRecurring && $isMonthlyConvert;
Avoid too many return
statements within this method. Open
return (bool)$result;
Avoid too many return
statements within this method. Open
return null;
Avoid too many return
statements within this method. Open
return '';
Avoid too many return
statements within this method. Open
return $convertAmounts['USD'];
Function addRetryLink
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected function addRetryLink( &$data ) {
$params = [];
if ( !$this->gateway->session_hasDonorData() ) {
foreach ( DonationData::getRetryFields() as $field ) {
if ( isset( $data[$field] ) ) {
- 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 getRiskScore
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function getRiskScore( $scoreArray = null ) {
if ( $scoreArray === null ) {
$scoreArray = $this->risk_score;
}
- 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 setClientVariables
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function setClientVariables( &$vars ): void {
parent::setClientVariables( $vars );
$vars['dlocalScript'] = $this->adapter->getAccountConfig( 'dlocalScript' );
$vars['DonationInterfaceThankYouPage'] = ResultPages::getThankYouPage( $this->adapter );
$supportedSubmethods = array_keys( $this->adapter->getAvailableSubmethods() );
- 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 setAmountLabelKey
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected function setAmountLabelKey( &$data ): void {
if ( $data['recurring'] ) {
$isAnnual = ( isset( $data['frequency_unit'] ) && $data['frequency_unit'] == 'year' );
if ( $isAnnual ) {
$key = 'donate_interface-annual-amount';
- 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"