Showing 120 of 336 total issues
Function useSongMenuMethods
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const useSongMenuMethods = (songs: Ref<Song[]>, close: Closure) => {
const { addSongsToPlaylist } = usePlaylistManagement()
const queueSongsAfterCurrent = () => {
close()
Function init
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const init = (el: ElementWithTooltip, binding: DirectiveBinding) => {
const $tooltip = getOrCreateTooltip(el)
// make sure the actual title is removed from the element, but keep a backup for the updated() hook calls
$tooltip.querySelector<HTMLDivElement>('.tooltip-content')!.innerText = binding.value
Function init
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
init (mediaElement: HTMLMediaElement) {
this.element = mediaElement
this.context = new AudioContext()
this.preampGainNode = this.context.createGain()
Function test
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected test () {
it('sets and gets a value', () => {
cache.set('foo', 'bar')
expect(cache.get('foo')).toBe('bar')
})
Function test
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected test () {
it('renders the playlist', async () => {
await this.renderComponent(factory<Song>('song', 10))
await waitFor(() => {
Function test
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected test () {
it.each<[MediaInfoDisplayMode]>([['aside'], ['full']])('renders in %s mode', async (mode) => {
await this.renderComponent(mode)
if (mode === 'aside') {
Function test
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected test () {
it('invites single email', async () => {
const inviteMock = this.mock(invitationService, 'invite')
const alertMock = this.mock(MessageToasterStub.value, 'success')
Function useSongListControls
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const useSongListControls = () => {
const { isCurrentScreen } = useRouter()
const getSongListControlsConfig = () => {
const config: SongListControlsConfig = {
Method createSongEntry
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
string $bucket,
string $key,
string $artistName,
string $albumName,
string $albumArtistName,
Function test
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected test () {
it('downloads', async () => {
const downloadMock = this.mock(downloadService, 'fromAlbum')
await this.renderComponent()
Function test
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected test () {
it('renders an empty state if no songs found', async () => {
commonStore.state.song_length = 0
this.mock(overviewStore, 'init')
Function test
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected test () {
it('functions', async () => {
const song = factory<Song>('song')
const searchMock = this.mock(youTubeService, 'searchVideosBySong').mockResolvedValueOnce({
Function initScene
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
initScene () {
const _sphere_size = .7
const _geom = new THREE.SphereGeometry(_sphere_size, 128, 128)
const _geom_lowres = new THREE.SphereGeometry(_sphere_size, 64, 64)
Function test
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected test () {
it('downloads songs', () => {
const mock = this.mock(downloadService, 'trigger')
downloadService.fromSongs([factory<Song>('song', { id: 'foo' }), factory<Song>('song', { id: 'bar' })])
Function update
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
update () {
this.analyzer.getByteFrequencyData(this.audioBuffer)
let bass = 0., mid = 0., high = 0.
if (this.audioBuffer[0] === 0) {
Function constructor
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
constructor () {
this.client = Axios.create({
baseURL: `${window.BASE_URL}api`,
headers: {
'X-Api-Version': 'v6'
Method make
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
?string $title,
?string $artistName,
?string $albumName,
?string $albumArtistName,
?int $track,
Method __construct
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public ?string $title,
public ?string $artistName,
public ?string $albumName,
public ?string $albumArtistName,
public ?int $track,
Function test
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected test () {
it('renders the queue', () => {
this.renderComponent(factory<Song>('song', 3))
expect(screen.queryByTestId('song-list')).toBeTruthy()
Function usePlaylistManagement
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const usePlaylistManagement = () => {
const { toastSuccess } = useMessageToaster()
const { showErrorDialog } = useDialogBox()
const addSongsToPlaylist = async (playlist: Playlist, songs: Song[]) => {