Showing 134 of 387 total issues
Function constructor
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
constructor () {
this.client = Axios.create({
baseURL: `${window.BASE_URL}api`,
headers: {
'X-Api-Version': 'v6',
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')
Method acquireReleaseVersionInteractively
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function acquireReleaseVersionInteractively(): string
{
$patchVersion = (clone $this->currentVersion)->incrementPatch()->prefix();
$suggestedVersions = [
Function generate
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
const generate = (partOfCompilation = false): Song => {
const artistId = faker.datatype.number({ min: 3 })
const artistName = faker.name.findName()
return {
Function update
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
update () {
const shaders = [
this.shaderMesh,
this.shaderWire,
this.shaderPoints,
Function renderComponent
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected async renderComponent () {
commonStore.state.uses_last_fm = true
artist = factory('artist', {
id: 42,
Method __invoke
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
ITunesService $iTunesService,
SettingRepository $settingRepository,
SongRepository $songRepository,
PlaylistRepository $playlistRepository,
ApplicationInformationService $applicationInformationService,
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
Function play
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public async play (playable: Playable, position = 0) {
if (isEpisode(playable)) {
useEpisodeProgressTracking().trackEpisode(playable)
}
- 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 resolve
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public async resolve () {
if (!location.hash || location.hash === '#/' || location.hash === '#!/') {
return Router.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 __invoke
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
SongStorage $storage,
AlbumRepository $albumRepository,
SongRepository $songRepository,
UploadRequest $request,
Authenticatable $user
Method getByGenre
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
string $genre,
array $sortColumns,
string $sortDirection,
?User $scopedUser = null,
int $perPage = 50
Method __invoke
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
UpdatePlaybackStatusRequest $request,
SongRepository $songRepository,
QueueService $queueService,
PodcastService $podcastService,
Authenticatable $user
Method __construct
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public string $provider,
public string $id,
public string $email,
public string $name,
public ?string $avatar,
Method handle
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function handle($request, Closure $next, $maxAttempts = 600, $decayMinutes = 1, $prefix = ''): Response
Method __invoke
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Playlist $playlist,
SongRepository $repository,
SmartPlaylistService $smartPlaylistService,
DownloadService $download,
Authenticatable $user
Method getForListing
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
array $sortColumns,
string $sortDirection,
bool $ownSongsOnly = false,
?User $scopedUser = null,
int $perPage = 50
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 getLocalPath
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function getLocalPath(Song $song): ?string
{
if (!$song->storage->supported()) {
return null;
}
- 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"