Showing 1,426 of 1,426 total issues
Avoid deeply nested control flow statements. Open
if ( cellData === null ) {
cellData = '';
}
Avoid deeply nested control flow statements. Open
for ( j=0, jen=items.length ; j<jen ; j++ ) {
item = items[j];
if ( type === 'cell' ) {
ret = fn.call( apiInst, context[i], item.row, item.column, i, j );
Avoid deeply nested control flow statements. Open
if ( ! detectedType && j !== types.length-1 ) {
break;
}
Avoid deeply nested control flow statements. Open
if ( type === 'column-rows' ) {
rows = _selector_row_indexes( context[i], selector.opts );
}
Function getTieBreakerByLocaleAndChannel
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. 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
Function login
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function login(Request $request): Response
{
$form = $this->createLoginForm();
$form->handleRequest($request);
- 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
string $id,
string $name,
int $numberOfEmployees,
Collection $translatedAliasEntities,
UserEntity $user,
Method __construct
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
QuizChannel $quizChannel,
?Alias $companyAlias,
?Alias $partnerAlias,
?UuidInterface $teamId,
Language $language,
Function bootstrap
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
DataTable.ext.renderer.pageButton.bootstrap = function ( settings, host, idx, buttons, page, pages ) {
Method __construct
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
UuidInterface $id,
Year $year,
QuizChannel $channel,
Language $language,
NotEmptyString $question,
Method __construct
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
QuestionRepository $questionRepository,
CategoryRepository $categoryRepository,
QuizCompositionRepository $quizCompositionRepository,
UuidFactoryInterface $uuidFactory,
Year $year,
Method __construct
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
string $uuid,
int $playhead,
string $payload,
string $metadata,
string $recordedOn,
Method __construct
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
UuidInterface $id,
NotEmptyString $name,
PositiveNumber $numberOfEmployees,
TranslatedAliases $translatedAliases,
User $user,
Method newContestParticipationFromData
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
UuidFactoryInterface $uuidFactory,
Year $year,
Language $language,
QuizChannel $channel,
Email $email,
Method __construct
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Swift_Mailer $swiftMailer,
Twig_Environment $twig,
TranslatorInterface $translator,
UrlGeneratorInterface $urlGenerator,
string $projectDir,
Method __construct
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
UuidFactoryInterface $uuidFactory,
UserRepository $userRepository,
CompanyRepository $companyRepository,
SerializerInterface $serializer,
TranslatorInterface $translator,
Function editContact
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function editContact(Request $request, ?string $id): Response
{
if ($id === null) {
$user = $this->userRepository->getByEmail(new Email($this->getUser()->getUsername()));
} elseif ($this->get('security.authorization_checker')->isGranted('ROLE_CONTACT')) {
- 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 generateQuiz
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
QuizChannel $channel,
?Company $company,
?Partner $partner,
?Team $team,
Language $language,
Function guardChannel
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private function guardChannel(QuizChannel $channel, ?Company $company, ?Partner $partner, ?Team $team): void
{
switch ($channel->toNative()) {
case QuizChannel::INDIVIDUAL:
case QuizChannel::LEAGUE:
- 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
UuidInterface $id,
UrlSuffix $hashCode,
User $user,
\DateTimeImmutable $createdOn,
bool $passwordReset,