Showing 203 of 288 total issues
Function showPopup
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function showPopup(editor, code, language, direction, callback) {
Method createJointPermissionData
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
protected function createJointPermissionData(SimpleEntityData $entity, int $roleId, MassEntityPermissionEvaluator $permissionMap, array $rolePermissionMap, bool $isAdminRole): array
Method replaceValueInTable
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Connection $db,
string $table,
string $column,
string $oldUrl,
string $newUrl
Method sendNotificationToUserIds
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
protected function sendNotificationToUserIds(string $notification, array $userIds, User $initiator, string|Loggable $detail, Entity $relatedModel): void
Method __construct
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
$name,
UserProvider $provider,
Session $session,
LdapService $ldapService,
RegistrationService $registrationService
Method resizeImageData
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
string $imageData,
?int $width,
?int $height,
bool $keepRatio,
?string $format = null,
Method getDefault
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public static function getDefault(string $event, Webhook $webhook, $detail, User $initiator, int $initiatedTime): self
Method __construct
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function __construct(string $event, Webhook $webhook, string|Loggable $detail, User $initiator, int $initiatedTime)
Method resizeToThumbnailUrl
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Image $image,
?int $width,
?int $height,
bool $keepRatio = false,
bool $shouldCreate = false
Method __construct
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
protected TagRepo $tagRepo,
protected ImageRepo $imageRepo,
protected ReferenceUpdater $referenceUpdater,
protected ReferenceStore $referenceStore,
protected PageQueries $pageQueries,
Method __construct
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public BookshelfQueries $shelves,
public BookQueries $books,
public ChapterQueries $chapters,
public PageQueries $pages,
public PageRevisionQueries $revisions,
Method __construct
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function __construct(int $id, int $sort, ?int $parentChapterId, string $type, int $parentBookId)
Method isSortChangePermissible
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
protected function isSortChangePermissible(BookSortMapItem $sortMapItem, BookChild $model, ?Entity $currentParent, ?Entity $newBook, ?Entity $newChapter): bool
Method __construct
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
protected BookshelfRepo $shelfRepo,
protected BookshelfQueries $queries,
protected BookQueries $bookQueries,
protected ShelfContext $shelfContext,
protected ReferenceFetcher $referenceFetcher,
Method __construct
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
protected ShelfContext $shelfContext,
protected BookRepo $bookRepo,
protected BookQueries $queries,
protected BookshelfQueries $shelfQueries,
protected ReferenceFetcher $referenceFetcher,
Function registerUser
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function registerUser(array $userData, ?SocialAccount $socialAccount = null, bool $emailConfirmed = false): User
{
$userEmail = $userData['email'];
$authSystem = $socialAccount ? $socialAccount->driver : auth()->getDefaultDriver();
- 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 updateContent
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
async function updateContent(pngData) {
const loadingImage = window.baseUrl('/loading.gif');
const handleUploadError = error => {
if (error.status === 413) {
- 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 checkUserHasAccessToRelationOfImageAtPath
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
protected function checkUserHasAccessToRelationOfImageAtPath(string $path): bool
{
if (str_starts_with($path, 'uploads/images/')) {
$path = substr($path, 15);
}
- 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 parseRefs
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function parseRefs(name, element) {
const refs = {};
const manyRefs = {};
const prefix = `${name}@`;
- 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 selectItem
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
selectItem(item) {
const isDblClick = this.isDoubleClick();
const type = item.getAttribute('data-entity-type');
const id = item.getAttribute('data-entity-id');
const isSelected = (!item.classList.contains('selected') || isDblClick);
- 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"