Showing 143 of 652 total issues
Function PlaylistView
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
const PlaylistView: React.FC<PlaylistViewProps> = ({
playlist,
updatePlaylist,
deletePlaylist,
exportPlaylist,
- 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 getMenu
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
getMenu() {
const template = [];
// Playing status
if (this.playerContext.track) {
- 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 NuclearSignUpFormContainer
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export const NuclearSignUpFormContainer: React.FC<NuclearSignUpFormContainerProps> = ({
isOpen,
onClose
}) => {
const { t } = useTranslation('forms', { keyPrefix: 'nuclear-sign-up' });
- 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 generateNotification
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function generateNotification(title: string, details: string, icon: Node | React.ReactElement<{
src: string;
}>, type: {[type:string]: boolean}, settings: Setting[] | { [key: string]: unknown }) {
Function useResizablePanel
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export const useResizablePanel = ({
initialWidth,
collapsedWidth,
collapseThreshold,
isCollapsed,
- 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 SpotifyPlaylistImporter
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const SpotifyPlaylistImporter: React.FC<SpotifyPlaylistImporterProps> = ({
trigger,
onClose: onCloseProp
}) => {
const { t } = useTranslation('playlists');
- 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 eventEmitterControllerFactory
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const eventEmitterControllerFactory = (metadataKey: symbol): ClassDecorator => (prefix?: string) => {
/**
* Get the metadata attached to the class by event decorator and add the prefix to eventNames if prefix is defined
* @param target - the instance of the decorated class
* @returns - the decorated class ready to use with inversify Container
- 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 renderTrackListPane
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
renderTrackListPane(collection) {
if (typeof collection !== 'undefined') {
return (
<Tab.Pane loading={this.props.unifiedSearchStarted} attached={false}>
- 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 7 (exceeds 5 allowed). Consider refactoring. Open
async play() {
if (this.isReady && this.activity) {
this.pausedTotal += Date.now() - this.pauseStart;
if (this.activity) {
if (this.isPaused) {
- 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 useSpotifyPlaylistImporterProps
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export const useSpotifyPlaylistImporterProps = (t: TFunction<string>) => {
const dispatch = useDispatch();
const onImportFromUrl = useCallback((data: SpotifyPlaylist) => {
dispatch(PlaylistActions.addPlaylistFromUrl(data, t));
}, [dispatch, t]);
- 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 LibraryView
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const LibraryView = ({
tracksMap,
filter,
expandedFolders,
streamProviders,
- 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 usePlayerControlsProps
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export const usePlayerControlsProps = () => {
const dispatch = useDispatch();
const queue = useSelector(queueSelector);
const settings = useSelector(settingsSelector);
const playbackStatus = useSelector(playerSelectors.playbackStatus);
- 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 useResizablePanel
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const useResizablePanel = ({
initialWidth,
collapsedWidth,
collapseThreshold,
isCollapsed,
- 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 extractTrackData
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const extractTrackData = (track, streamSource: string = null): PlaylistTrack => {
const trackStreams = track.streams || streamSource ? [{ source: streamSource, id: track.id }] : [];
return track && (track.name || track.title) && (!track.type || track.type === 'track') ?
{
- 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 TrackRow
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const TrackRow: React.FC<TrackRowProps> = ({
track,
mini,
displayAlbum,
displayArtist,
- 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 render
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
render() {
const { queue, player, equalizer, actions, enableSpectrum, currentStream, location, defaultEqualizer } = this.props;
const currentTrack = queue.queueItems[queue.currentSong];
const usedEqualizer = enableSpectrum ? equalizer : defaultEqualizer;
- 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 fetchArtistDetails
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
async fetchArtistDetails(artistId: string): Promise<ArtistDetails> {
const AudiusInfo: AudiusArtistInfo = (await ((await Audius.getArtist(this.apiEndpoint, artistId)).json())).data;
AudiusInfo.name = cleanName(AudiusInfo.name);
const lastFmInfo: LastFmArtistInfo = (await (await this.lastfm.getArtistInfo(AudiusInfo.name)).json()).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 SearchBox
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const SearchBox: React.FC<SearchBarProps> = ({
loading,
disabled,
placeholder,
searchProviders,
- 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 retryWithExponentialBackoff
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export async function retryWithExponentialBackoff<T>(
apiCall: () => Promise<T>,
maxRetries = 3,
delayMs = 1000
): Promise<T> {
- 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 PromotedArtistsContainer
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const PromotedArtistsContainer: React.FC = () => {
const dispatch = useDispatch();
const history = useHistory();
const isPromotedArtistFeatureEnabled = useSelector(isConfigFlagEnabled(ConfigFlag.PROMOTED_ARTISTS));
const promotedArtistBackground = useSelector(paramValue(ParamKey.PROMOTED_ARTIST_BACKGROUND));
- 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"