wikimedia/mediawiki-extensions-DonationInterface

View on GitHub

Showing 275 of 311 total issues

Avoid too many return statements within this method.
Open

                return $this->captureOneTimePayment( $provider );
Severity: Major
Found in paypal_ec_gateway/paypal_express.adapter.php - About 30 mins to fix

    Avoid too many return statements within this method.
    Open

            return PaymentResult::fromResults(
                new PaymentTransactionResponse(),
                $this->getFinalStatus()
            );
    Severity: Major
    Found in paypal_ec_gateway/paypal_express.adapter.php - About 30 mins to fix

      Avoid too many return statements within this method.
      Open

                      return;
      Severity: Major
      Found in adyen_gateway/adyen_submit_payment.api.php - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

                            return;
        Severity: Major
        Found in adyen_gateway/adyen_submit_payment.api.php - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

                      return !is_array( $value );
          Severity: Major
          Found in gateway_common/DataValidator.php - About 30 mins to fix

            Avoid too many return statements within this method.
            Open

                        return false;
            Severity: Major
            Found in gateway_common/DataValidator.php - About 30 mins to fix

              Avoid too many return statements within this method.
              Open

                          return false;
              Severity: Major
              Found in gateway_common/gateway.adapter.php - About 30 mins to fix

                Avoid too many return statements within this method.
                Open

                        return $employerList;
                Severity: Major
                Found in gateway_common/employerSearch.api.php - About 30 mins to fix

                  Avoid too many return statements within this method.
                  Open

                              return;
                  Severity: Major
                  Found in gateway_common/GatewayPage.php - About 30 mins to fix

                    Avoid too many return statements within this method.
                    Open

                                return true;
                    Severity: Major
                    Found in gateway_common/DataValidator.php - About 30 mins to fix

                      Avoid too many return statements within this method.
                      Open

                                  return;
                      Severity: Major
                      Found in gateway_common/GatewayPage.php - About 30 mins to fix

                        Avoid too many return statements within this method.
                        Open

                                return !$isRecurring && $isMonthlyConvert;
                        Severity: Major
                        Found in gateway_common/gateway.adapter.php - About 30 mins to fix

                          Avoid too many return statements within this method.
                          Open

                                  return (bool)$result;
                          Severity: Major
                          Found in gateway_common/DataValidator.php - About 30 mins to fix

                            Avoid too many return statements within this method.
                            Open

                                    return null;
                            Severity: Major
                            Found in gateway_common/gateway.adapter.php - About 30 mins to fix

                              Avoid too many return statements within this method.
                              Open

                                              return '';
                              Severity: Major
                              Found in gateway_common/gateway.adapter.php - About 30 mins to fix

                                Avoid too many return statements within this method.
                                Open

                                            return $convertAmounts['USD'];
                                Severity: Major
                                Found in gateway_common/gateway.adapter.php - About 30 mins to fix

                                  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] ) ) {
                                  Severity: Minor
                                  Found in gateway_forms/MustacheErrorForm.php - About 25 mins to fix

                                  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;
                                          }
                                  
                                  
                                  Severity: Minor
                                  Found in extras/custom_filters/custom_filters.body.php - About 25 mins to fix

                                  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() );
                                  Severity: Minor
                                  Found in dlocal_gateway/dlocal_gateway.body.php - About 25 mins to fix

                                  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';
                                  Severity: Minor
                                  Found in gateway_forms/Mustache.php - About 25 mins to fix

                                  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

                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language