Showing 275 of 311 total issues
Method getLoggerFromParams
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public static function getLoggerFromParams( $identifier, $useSyslog, $debug, $suffix, $prefixer ) {
Function paramsForRecurUpgradeForm
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
protected function paramsForRecurUpgradeForm( $checksum, $contactID, $country ): ?array {
$recurData = CiviproxyConnect::getRecurDetails( $checksum, $contactID );
if ( $recurData[ 'is_error' ] ) {
$logger = self::getLogger();
- 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 render
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public static function render( $fileName, $data, $options = [] ) {
$defaultOptions = [
'flags' => LightnCandy::FLAG_ERROR_EXCEPTION | LightnCandy::FLAG_ADVARNAME,
];
if ( isset( $options['flags'] ) ) {
- 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 suggest
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
suggest: function(email, domains, topLevelDomains, distanceFunction) {
email = email.toLowerCase();
var emailParts = this.splitEmail(email);
- 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 processDonorReturn
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function processDonorReturn( $requestValues ): PaymentResult {
// DLocal currently does not send us the correct return parameters
// on coming back from recurring UPI (at least in sandbox).
// In any case, we don't want to send a message to the donations
// queue from the front-end for recurring UPI because we need to
- 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 getPartials
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
protected function getPartials( array $data ) {
$partials = [];
if ( empty( $data['variant'] ) ) {
$variantDir = false;
} else {
- 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 validateAmount
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
protected function validateAmount( array $params, bool $posted ): bool {
if ( !$posted || ( isset( $params['submit'] ) && $params['submit'] === 'cancel' ) ) {
// Not doing anything with the parameters unless we're posted, so don't worry about them
return 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 addHitToVelocityData
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
protected static function addHitToVelocityData( $stored = false, $timeout = false ): array {
$new_velocity_records = [];
$nowstamp = time();
if ( is_array( $stored ) ) {
foreach ( $stored as $timestamp ) {
- 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 languageSpecificFallback
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public static function languageSpecificFallback(
$language = 'en', $msg_keys = [], $params = []
) {
if ( count( $msg_keys ) < 1 ) {
throw new InvalidArgumentException( __FUNCTION__ . " BAD PROGRAMMER. No message keys given." );
- 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 populateData
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
protected function populateData( $external_data = false ) {
$this->normalized = [];
if ( is_array( $external_data ) ) {
// I don't care if you're a test or not. At all.
$this->normalized = $external_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 getClientSideValidation
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function getClientSideValidation( $normalized, &$clientRules ) {
if (
!isset( $normalized['country'] ) ||
empty( self::$countryRules[$normalized['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
Function finalizeInternalStatus
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function finalizeInternalStatus( $status ) {
/**
* Handle session stuff!
* -Behavior-
* * Always, always increment numAttempt.
- 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 hasValidationError
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function hasValidationError( $field = null ) {
foreach ( $this->errors as $error ) {
if ( $error instanceof ValidationError ) {
if ( $field === null || $error->getField() === $field ) {
return 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 trimFieldToConstraints
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
protected function trimFieldToConstraints( $value, $field ) {
// Trim all values if they are a string
$value = is_string( $value ) ? trim( $value ) : $value;
if ( isset( $this->dataConstraints[$field] ) && is_string( $value ) ) {
- 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 checkValidationPassed
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
protected static function checkValidationPassed( $fields, $results ) {
foreach ( $fields as $field ) {
foreach ( $results as $phase => $results_fields ) {
if ( array_key_exists( $field, $results_fields )
&& $results_fields[$field] !== 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 setNormalizedRecurring
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
protected function setNormalizedRecurring() {
if ( $this->isSomething( 'recurring_paypal' ) && ( $this->getVal( 'recurring_paypal' ) === '1' || $this->getVal( 'recurring_paypal' ) === 'true' ) ) {
$this->setVal( 'recurring', true );
$this->expunge( 'recurring_paypal' );
}
- 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 setAdapterAndValidate
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
protected function setAdapterAndValidate() {
$this->ensureState();
DonationInterface::setSmashPigProvider( $this->gateway );
- 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
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 $this->createRecurringProfile( $provider );