Showing 275 of 275 total issues
Function session_resetOnSwitch
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
protected function session_resetOnSwitch() {
$oldData = $this->session_getData( 'Donor' );
if ( !is_array( $oldData ) ) {
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
DataValidator
has 26 functions (exceeds 20 allowed). Consider refactoring. Open
class DataValidator {
/**
* getErrorToken, intended to be used by classes that exist relatively close
* to the form classes, returns the error token (defined on the forms) that
Function processDonorReturn
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
public function processDonorReturn( $requestValues ) {
// FIXME: make sure we're processing the order ID we expect!
/** @var HostedCheckoutProvider $provider */
$provider = $this->getPaymentProvider();
'@phan-var HostedCheckoutProvider $provider';
- 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 execute
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function execute( $par ) {
// FIXME: Deprecate "language" param.
$language = $this->getRequest()->getVal( 'language' );
$this->showError = $this->getRequest()->getBool( 'showError' );
Function addSubmethods
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
protected function addSubmethods( &$data ) {
if ( !$this->gatewayPage->showSubmethodButtons() ) {
$data['show_submethods'] = false;
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
Function getDonationRules
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
public function getDonationRules(): array {
$rules = $this->config['donation_rules'];
foreach ( $rules as $rule ) {
// Do our $params match all the conditions for this rule?
$ruleMatches = 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
File amazon.js
has 281 lines of code (exceeds 250 allowed). Consider refactoring. Open
/*global amazon:true, OffAmazonPayments:true*/
( function ( $, mw ) {
var clientId = mw.config.get( 'wgAmazonGatewayClientID' ),
sellerId = mw.config.get( 'wgAmazonGatewaySellerID' ),
sandbox = mw.config.get( 'wgAmazonGatewaySandbox' ),
Method handleCreatedPayment
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function handleCreatedPayment(
IPaymentProvider $provider, PaymentDetailResponse $authorizeResult
): PaymentResult {
$transactionStatus = $authorizeResult->getStatus();
$responseData = [
Method execute
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function execute() {
$this->gateway = 'amazon';
DonationInterface::setSmashPigProvider( 'amazon' );
$output = $this->getResult();
$recurring = $this->getParameter( 'recurring' );
Method handleResultRequest
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function handleResultRequest() {
// no longer letting people in without these things. If this is
// preventing you from doing something, you almost certainly want to be
// somewhere else.
$deadSession = false;
Function validate
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
public function validate( GatewayType $unused, $normalized, &$errors ) {
if (
!isset( $normalized['country'] ) ||
!isset( $normalized[self::$key] )
) {
- 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 setCountry
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
protected function setCountry() {
$regen = true;
$country = '';
if ( $this->isSomething( 'country' ) ) {
- 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 processDonorReturn
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function processDonorReturn( $requestValues ) {
if (
empty( $requestValues['token'] )
) {
throw new ResponseProcessingException(
File minfraud.body.php
has 273 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Wikimedia Foundation
*
* LICENSE
Method processDonorReturn
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function processDonorReturn( $requestValues ) {
// FIXME: make sure we're processing the order ID we expect!
/** @var HostedCheckoutProvider $provider */
$provider = $this->getPaymentProvider();
'@phan-var HostedCheckoutProvider $provider';
Function createAndMountComponent
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
function createAndMountComponent( config, component_type, containerName ) {
var component_config = getComponentConfig( component_type, config ),
component = checkout.create( component_type, component_config );
if ( component_type === GOOGLEPAY_COMPONENT_TYPE ) {
Method paramsForPreferencesForm
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function paramsForPreferencesForm( $checksum, $contact_id ) {
$prefs = CiviproxyConnect::getEmailPreferences( $checksum, $contact_id );
if ( $prefs[ 'is_error' ] ) {
$logger = DonationLoggerFactory::getLoggerFromParams(
File amazon.adapter.php
has 268 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
use PayWithAmazon\PaymentsClientInterface as PwaClientInterface;
use Psr\Log\LogLevel;
use SmashPig\Core\Context;
Function handleCreatedPayment
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
protected function handleCreatedPayment(
PaymentDetailResponse $paymentDetailResponse,
IPaymentProvider $paymentProvider
): PaymentResult {
// Log details of the payment in case we need to reconstruct it for
- 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 handleCreatedPayment
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
protected function handleCreatedPayment(
IPaymentProvider $provider, PaymentDetailResponse $authorizeResult
): PaymentResult {
$transactionStatus = $authorizeResult->getStatus();
$responseData = [
- 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"