Showing 143 of 665 total issues
Function renderPlugins
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
private renderPlugins() {
const { children } = this.props;
if (Array.isArray(children)) {
const flatChildren = children.flat() as ReactElement[];
Function mountComponent
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
const mountComponent = (initialStore?: AnyProps, initStore = true) => {
const initialState = initialStore ||
buildStoreState()
.withPlaylists()
.withPlugins()
Function renderPane
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
renderPane(collection, onClick) {
const selectedProvider = _.find(this.props.metaProviders, { sourceName: this.props.selectedPlugins.metaProviders });
return (
<Tab.Pane loading={this.props.unifiedSearchStarted} attached={false}>
Function mountComponent
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
const mountComponent = (initialStore?: AnyProps, initStore = true) => {
const initialState = initialStore ||
buildStoreState()
.withPlugins()
.withPlaylists()
Function componentWillUnmount
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
componentWillUnmount() {
Mousetrap.unbind([
'space',
'enter',
'left',
Function onCompleted
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
onCompleted: (file) => {
this.window?.send(IpcEvents.DOWNLOAD_FINISHED, uuid);
this.logger.log(`Download success: ${artistName} - ${title}, path: ${file.path}`);
this.logger.log('');
this.downloadItems = this.downloadItems.filter((item) => item.uuid !== uuid);
Function Left
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const Left = () => {
const [isCollapsed, onCollapse] = useState(false);
const {
width,
onSetWidth
Function fetchArtistDetails
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
async fetchArtistDetails(artistId: string): Promise<ArtistDetails> {
const discogsInfo: DiscogsArtistInfo = await (await Discogs.artistInfo(artistId)).json();
discogsInfo.name = cleanName(discogsInfo.name);
const lastFmInfo: LastFmArtistInfo = (await (await this.lastfm.getArtistInfo(discogsInfo.name)).json()).artist;
Function getStreamForId
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const getStreamForId = async (id: string, sourceName: string, useSponsorBlock = true): Promise<StreamData> => {
try {
const videoUrl = baseUrl + id;
const trackInfo = await ytdl.getInfo(videoUrl);
const formatInfo = ytdl.chooseFormat(trackInfo.formats, { quality: 'highestaudio' });
Function ArtistView
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
const ArtistView: React.FC<ArtistViewProps> = ({
artist,
isFavorite,
addTrackToQueue,
artistInfoSearchByName,
- 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 handleFinishedPlaying
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
handleFinishedPlaying() {
const currentSong = this.props.queue.queueItems[
this.props.queue.currentSong
];
if (
- 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 StreamVerificationContainer
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export const StreamVerificationContainer: React.FC = () => {
const { t } = useTranslation('queue');
const dispatch = useDispatch();
const queue = useSelector(queueSelector);
const settings = useSelector(settingsSelector);
- 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 reduceRepositionSong
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
function reduceRepositionSong(state, action) {
const newQueue = _.cloneDeep(state.queueItems);
const [removed] = newQueue.splice(action.payload.itemFrom, 1);
newQueue.splice(action.payload.itemTo, 0, removed);
- 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 useCommandPaletteActions
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export const useCommandPaletteActions = (): CommandPaletteAction[] => {
const history = useHistory();
const dispatch = useDispatch();
const { t } = useTranslation('command-palette');
const settings = useSelector(settingsSelector);
- 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 eventListenerFactory
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
const eventListenerFactory = <T>(metadataKey: symbol): MethodDecorator<T, IpcEventOptions> => (
eventName,
options
) => {
/**
- 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 getEntries
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
async getEntries(request?: ListeningHistoryRequest): Promise<PagingResult<ListeningHistoryEntry>> {
const qb = this.listeningHistoryRepository.createQueryBuilder('entry');
if (request?.artist) {
qb.andWhere(`entry.artist = '${request.artist}'`);
- 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 exports
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
module.exports = (env) => {
const IS_PROD = env.NODE_ENV === 'production';
const IS_DEV = env.NODE_ENV === 'development';
const entry = IS_PROD
- 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 getChartOptions
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function getChartOptions(data) {
return {
type: 'line',
data,
options: {
- 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 handleCertificateError
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
export function handleCertificateError(event, webContents, url, error, certificate, callback) {
Function formatDuration
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export function formatDuration(duration) {
if (typeof duration === 'string') {
return duration;
}
- 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"