Showing 120 of 336 total issues
Function renderComponent
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
private async renderComponent () {
commonStore.state.use_last_fm = true
album = factory<Album>('album', {
id: 42,
Function test
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected test () {
it('renders', () => expect(this.render(SettingsScreen).html()).toMatchSnapshot())
it('submits the settings form', async () => {
const updateMock = this.mock(settingStore, 'update')
Function useInfiniteScroll
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const useInfiniteScroll = (loadMore: Closure) => {
const scroller = ref<HTMLElement>()
const scrolling = (event: UIEvent) => {
const target = event.target as HTMLElement
Function update
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
update () {
const shaders = [
this.shaderMesh,
this.shaderWire,
this.shaderPoints,
Function resolveDroppedSongs
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
const resolveDroppedSongs = async (event: DragEvent) => {
try {
const type = getDragType(event)
if (!type) return <Song[]>[]
Function getSongListControlsConfig
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
const getSongListControlsConfig = () => {
const config: SongListControlsConfig = {
play: true,
addTo: {
queue: true,
Method maybeSetUpDatabase
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function maybeSetUpDatabase(): void
{
$attempt = 0;
while (true) {
Function setup
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
setup (props, { slots }) {
let toastSuccess: ReturnType<typeof useMessageToaster>['toastSuccess']
let showConfirmDialog: ReturnType<typeof useDialogBox>['showConfirmDialog']
let go: ReturnType<typeof useRouter>['go']
Function renderComponent
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected async renderComponent () {
commonStore.state.use_last_fm = true
artist = factory<Artist>('artist', {
id: 42,
Function usePlaylistManagement
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export const usePlaylistManagement = () => {
const { toastSuccess } = useMessageToaster()
const { showErrorDialog } = useDialogBox()
const addSongsToPlaylist = async (playlist: Playlist, songs: Song[]) => {
- 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 useFloatingUi
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export const useFloatingUi = (
reference: HTMLElement | Ref<HTMLElement | undefined>,
floating: HTMLElement | Ref<HTMLElement | undefined>,
config: Partial<Config> = {}
) => {
- 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
private SongService $songService,
private SongRepository $songRepository,
private AlbumRepository $albumRepository,
private ArtistRepository $artistRepository,
private LibraryManager $libraryManager,
Method __invoke
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
ITunesService $iTunesService,
SettingRepository $settingRepository,
SongRepository $songRepository,
ApplicationInformationService $applicationInformationService,
QueueService $queueService,
Method __construct
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
private MediaCacheService $mediaCacheService,
private Artisan $artisan,
private Hash $hash,
private DotenvEditor $dotenvEditor,
private DB $db,
Method __construct
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
private getID3 $getID3,
private MediaMetadataService $mediaMetadataService,
private SongRepository $songRepository,
private SimpleLrcReader $lrcReader,
private Cache $cache,
Function resolve
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public async resolve () {
if (!location.hash || location.hash === '#/' || location.hash === '#!/') {
return this.go(this.homeRoute.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 init
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export const init = async (container: HTMLElement) => {
const gl = document.createElement('canvas').getContext('webgl')!
const postctx = container.appendChild(document.createElement('canvas')).getContext('2d')!
const postprocess = postctx.canvas
const canvas = gl.canvas
- 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 5 arguments (exceeds 4 allowed). Consider refactoring. Open
private SettingRepository $settingRepository,
private SongRepository $songRepository,
private FileSynchronizer $fileSynchronizer,
private Finder $finder,
private LoggerInterface $logger
Method updateUser
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function updateUser(User $user, string $name, string $email, string|null $password, bool $isAdmin): User
Method writeArtistImage
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Artist $artist,
string $source,
string $extension = 'png',
?string $destination = '',
bool $cleanUp = true