Showing 275 of 311 total issues
Function addDonorDetailsToSession
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected function addDonorDetailsToSession( PaymentDetailResponse $detailResponse ): void {
$donorDetails = $detailResponse->getDonorDetails();
if ( $donorDetails !== null ) {
$responseData = [
'first_name' => $donorDetails->getFirstName(),
- 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 validateToken
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected function validateToken( array $params, $posted ) {
if ( empty( $params['token'] ) ) {
if ( $posted ) {
return false;
}
- 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 validateEmail
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected function validateEmail( array $params, $posted ) {
if ( empty( $params['email'] ) ) {
// When we post back, we need an email
if ( $posted ) {
return false;
- 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 validateToken
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected function validateToken( array $params, $posted ) {
if ( empty( $params['token'] ) ) {
if ( $posted ) {
return false;
}
- 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 determineAction
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected function determineAction() {
$risk_score = $this->getRiskScore();
// possible risk scores are between 0 and 100
if ( $risk_score < 0 ) {
$risk_score = 0;
- 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 getScoreUtmSourceMap
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function getScoreUtmSourceMap() {
$score = 0;
$source = $this->getData_Unstaged_Escaped( 'utm_source' );
$sourceMap = $this->getGlobal( 'UtmSourceMap' );
- 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 addData
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function addData( $newdata, $source = 'internal' ) {
if ( is_array( $newdata ) ) {
foreach ( $newdata as $key => $val ) {
if ( !is_array( $val ) ) {
$this->setVal( $key, $val );
- 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 getScoreUtmMediumMap
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function getScoreUtmMediumMap() {
$score = 0;
$medium = $this->getData_Unstaged_Escaped( 'utm_medium' );
$mediumMap = $this->getGlobal( 'UtmMediumMap' );
- 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 normalize
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected function normalize() {
// FIXME: there's a ghost invocation during DonationData construction.
// This condition should actually be "did data come from anywhere?"
if ( $this->normalized ) {
// Cast all values to string.
- 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 getPaymentSubmethodMeta
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function getPaymentSubmethodMeta( $payment_submethod = null, $payment_method = null ) {
if ( $payment_submethod === null ) {
$payment_submethod = $this->getPaymentSubmethod();
}
- 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 getEmployersList
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected function getEmployersList() {
$employersListDataFile = $this->getConfig()->get( 'DonationInterfaceEmployersListDataFileLocation' );
// Check the employer data file exists
if ( !file_exists( $employersListDataFile ) ) {
$this->setError( 'Employer data file doesn\'t exist: ' . $employersListDataFile );
- 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 ensureState
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected function ensureState() {
if ( !$this->donationData ) {
$this->donationData = $this->extractRequestParams();
}
- 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 getErrorMap
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function getErrorMap( $code, $options = [] ) {
$defaults = [
'translate' => false,
];
$options = array_merge( $defaults, $options );
- 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 setReferrer
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected function setReferrer() {
if ( !$this->isSomething( 'referrer' ) ) {
// Remove protocol and query strings to avoid tripping modsecurity
// TODO it would be a lot more privacy respecting to omit path too.
$referrer = '';
- 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 getScoreUtmCampaignMap
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function getScoreUtmCampaignMap() {
$score = 0;
$campaign = $this->getData_Unstaged_Escaped( 'utm_campaign' );
$campaignMap = $this->getGlobal( 'UtmCampaignMap' );
- 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"