Showing 120 of 336 total issues
Method __invoke
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
UploadService $uploadService,
AlbumRepository $albumRepository,
SongRepository $songRepository,
UploadRequest $request,
Authenticatable $user
Method writeAlbumCover
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Album $album,
string $source,
string $extension = 'png',
?string $destination = '',
bool $cleanUp = true
Method createPlaylist
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
string $name,
User $user,
?Folder $folder = null,
array $songs = [],
?SmartPlaylistRuleGroupCollection $ruleGroups = null
Method handle
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function handle($request, Closure $next, $maxAttempts = 600, $decayMinutes = 1, $prefix = ''): Response
Method getByGenre
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
string $genre,
string $sortColumn,
string $sortDirection,
?User $scopedUser = null,
int $perPage = 50
Function maybeSetMediaPath
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private function maybeSetMediaPath(): void
{
if (Setting::get('media_path')) {
return;
}
- 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 buildUrl
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function buildUrl(string $uri, bool $appendKey = true): string
{
if (!starts_with($uri, ['http://', 'https://'])) {
if ($uri[0] !== '/') {
$uri = "/$uri";
- 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 tryMatchRoute
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private tryMatchRoute () {
if (!this.cache.has(location.hash)) {
for (let i = 0; i < this.routes.length; i++) {
const route = this.routes[i]
const matches = location.hash.match(new RegExp(`^#!?${route.path}/?(?:\\?(.*))?$`))
- 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 useInfiniteScroll
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export const useInfiniteScroll = (loadMore: Closure) => {
const scroller = ref<HTMLElement>()
const scrolling = (event: UIEvent) => {
const target = event.target as HTMLElement
- 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 useDraggable
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export const useDraggable = (type: DraggableType) => {
const startDragging = (event: DragEvent, dragged: Draggable) => {
if (!event.dataTransfer) {
return
}
- 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 getAllFileEntries
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
async function getAllFileEntries (dataTransferItemList: DataTransferItemList) {
const fileEntries: FileSystemEntry[] = []
const queue: FileSystemEntry[] = []
for (let i = 0, length = dataTransferItemList.length; i < length; i++) {
- 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 useUpload
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export const useUpload = () => {
const { isAdmin } = useAuthorization()
const { toastSuccess, toastWarning } = useMessageToaster()
const { go, isCurrentScreen } = useRouter()
- 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
Avoid too many return
statements within this function. Open
return <Song[]>[]
Avoid too many return
statements within this function. Open
return this.activateRoute(route, params)
Avoid too many return
statements within this method. Open
return $this->fromPlaylist($downloadable);
Avoid too many return
statements within this function. Open
return folder ? await songStore.fetchForPlaylistFolder(folder) : <Song[]>[]
Function sync
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function sync(array $ignores = [], bool $force = false): SyncResultCollection
{
/** @var string $mediaPath */
$mediaPath = $this->settingRepository->getByKey('media_path');
- 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 updateFloatingUi
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const updateFloatingUi = async (
reference: HTMLElement,
floating: HTMLElement,
options: Partial<ComputePositionConfig>,
arrow?: HTMLElement
- 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 sync
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function sync(array $ignores = [], bool $force = false): SyncResult
{
if (!$this->isFileNewOrChanged() && !$force) {
return SyncResult::skipped($this->filePath);
}
- 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 getMediaPath
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function getMediaPath(): string
{
$path = Setting::get('media_path');
if ($path) {
- 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"