Showing 428 of 1,426 total issues
Avoid deeply nested control flow statements. Open
Open
for ( var j=0, jLen=val.length ; j<jLen ; j++ )
{
o = {};
setData( o, val[j], innerSrc );
data[ a[i] ].push( o );
Avoid deeply nested control flow statements. Open
Open
if ( fomatters[ column.sType ] ) {
cellData = fomatters[ column.sType ]( cellData );
}
Avoid deeply nested control flow statements. Open
Open
if ( cellData === null ) {
cellData = '';
}
Avoid deeply nested control flow statements. Open
Open
for ( k=0 ; k<iRowspan ; k++ )
{
aLayout[i+k][iColShifted+l] = {
"cell": nCell,
"unique": bUnique
Avoid deeply nested control flow statements. Open
Open
if (value[props[prop_index]] != null) {
value = value[props[prop_index]];
}
Avoid deeply nested control flow statements. Open
Open
if ( arrayNotation )
{
// Array notation
a[i] = a[i].replace(__reArray, '');
Avoid deeply nested control flow statements. Open
Open
if ((tmp === -1 && search == 'removed') ||
(tmp >= 0 && search == 'applied') )
{
a.push( i );
}
Avoid deeply nested control flow statements. Open
Open
if ((value + '').toLowerCase() === s) {
return true;
}
Avoid deeply nested control flow statements. Open
Open
else if ( typeof aTargets[j] === 'number' && aTargets[j] < 0 )
{
/* Negative integer, right to left column counting */
fn( columns.length+aTargets[j], def );
}
Avoid deeply nested control flow statements. Open
Open
if ( typeof cellData !== 'string' && cellData.toString ) {
cellData = cellData.toString();
}
Avoid deeply nested control flow statements. Open
Open
if ((value + '').toLowerCase().indexOf(s) !== -1) {
return true;
}
Avoid deeply nested control flow statements. Open
Open
for ( k=0 ; k<iRowspan ; k++ )
{
aApplied[i+k][j+iColspan] = 1;
}
Avoid deeply nested control flow statements. Open
Open
if ( type === 'column-rows' ) {
rows = _selector_row_indexes( context[i], selector.opts );
}
Avoid deeply nested control flow statements. Open
Open
if ( cache[k] === undefined ) {
cache[k] = _fnGetCellData( settings, k, i, 'type' );
}
Avoid deeply nested control flow statements. Open
Open
while( columns.length <= aTargets[j] )
{
_fnAddColumn( oSettings );
}
Method generateQuiz
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
QuizChannel $channel,
?Company $company,
?Partner $partner,
?Team $team,
Language $language,
Method __construct
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
QuizChannel $quizChannel,
?Alias $companyAlias,
?Alias $partnerAlias,
?UuidInterface $teamId,
Language $language,
Function answerQuestion
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
public function answerQuestion(
\DateTimeImmutable $answeredOn,
?Answer $answer
): void {
if ($this->askingQuestion) {
- 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 getTieBreakerByLocaleAndChannel
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
private function getTieBreakerByLocaleAndChannel(string $locale, QuizChannel $channel): array
{
if (!$channel->equals(new QuizChannel(QuizChannel::LEAGUE))) {
$channel = new QuizChannel(QuizChannel::INDIVIDUAL);
}
- 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 __construct
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
string $id,
string $name,
int $numberOfEmployees,
Collection $translatedAliasEntities,
UserEntity $user,