Showing 428 of 1,426 total issues
Method __construct
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
QuestionRepository $questionRepository,
CategoryRepository $categoryRepository,
QuizCompositionRepository $quizCompositionRepository,
UuidFactoryInterface $uuidFactory,
Year $year,
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,
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
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 __construct
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
UuidInterface $id,
UrlSuffix $hashCode,
User $user,
\DateTimeImmutable $createdOn,
bool $passwordReset,
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,
Year $year,
QuizChannel $channel,
Language $language,
NotEmptyString $question,
Function getTraversableDomainMessages
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function getTraversableDomainMessages(
array $types = [],
int $firstId = null,
int $lastId = null,
callable $eventEntityFeedback = null,
- 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
UuidFactoryInterface $uuidFactory,
UserRepository $userRepository,
CompanyRepository $companyRepository,
SerializerInterface $serializer,
TranslatorInterface $translator,
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
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,
NotEmptyString $name,
PositiveNumber $numberOfEmployees,
TranslatedAliases $translatedAliases,
User $user,
Method __construct
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
string $id,
string $hashCode,
UserEntity $userEntity,
\DateTimeImmutable $createdOn,
bool $passwordReset,
Consider simplifying this complex logical expression. Open
if ( matcher[ expando ] ) {
// Find the next relative operator (if any) for proper handling
j = ++i;
for ( ; j < len; j++ ) {
if ( Expr.relative[ tokens[j].type ] ) {
Consider simplifying this complex logical expression. Open
if ( nCell.nodeName.toUpperCase() == "TD" ||
nCell.nodeName.toUpperCase() == "TH" )
{
/* Get the col and rowspan attributes from the DOM and sanitise them */
iColspan = nCell.getAttribute('colspan') * 1;
Consider simplifying this complex logical expression. Open
if ( tokens.length > 2 && (token = tokens[0]).type === "ID" &&
context.nodeType === 9 && documentIsHTML && Expr.relative[ tokens[1].type ] ) {
context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0];
if ( !context ) {
Consider simplifying this complex logical expression. Open
if (event && (event.type === 'click' && /input|textarea/i.test(event.target.tagName) || event.type === 'keyup' && event.which === TAB_KEYCODE) && $$$1.contains(parent, event.target)) {
continue;
}
Consider simplifying this complex logical expression. Open
if (version[0] < ltMajor && version[1] < minMinor || version[0] === minMajor && version[1] === minMinor && version[2] < minPatch || version[0] >= maxMajor) {
throw new Error('Bootstrap\'s JavaScript requires at least jQuery v1.9.1 but less than v4.0.0');
}
Consider simplifying this complex logical expression. Open
if (!isActive && (event.which !== ESCAPE_KEYCODE || event.which !== SPACE_KEYCODE) || isActive && (event.which === ESCAPE_KEYCODE || event.which === SPACE_KEYCODE)) {
if (event.which === ESCAPE_KEYCODE) {
var toggle = $$$1(parent).find(Selector.DATA_TOGGLE)[0];
$$$1(toggle).trigger('focus');
}