Showing 134 of 387 total issues
Function showNotification
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public showNotification (playable: Playable) {
if (!isSong(playable) && !isEpisode(playable)) {
throw new Error('Invalid playable type.')
}
- 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 { toastSuccess, toastWarning } = useMessageToaster()
const { go, isCurrentScreen } = useRouter()
const { currentUserCan } = usePolicies()
- 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 method. Open
return $cloudStorage->copyToLocal($song);
Avoid too many return
statements within this function. Open
return <Song[]>[]
Avoid too many return
statements within this method. Open
return null;
Avoid too many return
statements within this function. Open
return folder ? await songStore.fetchForPlaylistFolder(folder) : <Song[]>[]
Avoid too many return
statements within this function. Open
return showGenericError()
Avoid too many return
statements within this function. Open
return this.activateRoute(route, params)
Function usePolicies
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const usePolicies = () => {
const { currentUser, isAdmin } = useAuthorization()
const { isPlus } = useKoelPlus()
const currentUserCan = {
- 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 reportErroneousResult
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function reportErroneousResult(): void
{
$this->components->error('There are errors in your Koel setup. Koel will not work properly.');
if (File::isWritable(base_path('storage/logs/laravel.log'))) {
- 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 tryMatchRoute
has a Cognitive Complexity of 6 (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 upload
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
async upload (file: UploadFile) {
if (file.status === 'Uploading') {
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"