nukeop/nuclear

View on GitHub

Showing 65 of 208 total issues

Function getChartOptions has 50 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function getChartOptions(data) {
  return {
    type: 'line',
    data,
    options: {
Severity: Minor
Found in app/components/Equalizer/chart.js - About 2 hrs to fix

    Function renderSidebarMenu has 49 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      renderSidebarMenu () {
        return (
          <VerticalPanel
            className={classnames(styles.left_panel, {
              [`${compact.compact_panel}`]: this.props.settings.compactMenuBar
    Severity: Minor
    Found in app/App.js - About 1 hr to fix

      Function PlayerReducer has 44 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export default function PlayerReducer(state=initialState, action) {
        switch (action.type) {
        case START_PLAYBACK:
          return Object.assign({}, state, {
            playbackStatus: Sound.status.PLAYING
      Severity: Minor
      Found in app/reducers/player.js - About 1 hr to fix

        Function DownloadsReducer has 44 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export default function DownloadsReducer(state=initialState, action) {
          switch (action.type) {
          case ADD_TO_DOWNLOADS:
            return Object.assign({}, state, {
              downloads: _.concat(state.downloads, action.payload.item)
        Severity: Minor
        Found in app/reducers/downloads.js - About 1 hr to fix

          Function render has 44 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            render () {
              let { artist, tracks, t } = this.props;
          
              return (
                <div className={cx(
          Severity: Minor
          Found in app/components/ArtistView/PopularTracks/index.js - About 1 hr to fix

            Function renderOption has 43 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              renderOption (settings, option, key) {
                return (
                  <div
                    key={key}
                    className={
            Severity: Minor
            Found in app/components/Settings/index.js - About 1 hr to fix

              Function renderPlaylistInfo has 42 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                renderPlaylistInfo () {
                  let { playlist } = this.props;
                  let popupTrigger = (
                    <a href='#' className={styles.more_button}>
                      <Icon name='ellipsis horizontal' />
              Severity: Minor
              Found in app/components/PlaylistView/index.js - About 1 hr to fix

                Function registerDownloadsEvents has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                export const registerDownloadsEvents = window => {
                  ipcMain.once('started', event => {
                    rendererWindow = event.sender;
                  });
                  
                Severity: Minor
                Found in server/downloads.js - About 1 hr to fix

                  Function LibraryView has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                  Open

                  const LibraryView = ({
                    tracks,
                    actions,
                    pending,
                    localFolders,
                  Severity: Minor
                  Found in app/components/LibraryView/index.js - About 1 hr to fix

                  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 scanFoldersAndGetMeta has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  export async function scanFoldersAndGetMeta(directories, cache = {}) {
                    const baseFiles = await Promise.all(
                      _.flatMap(
                        SUPPORTED_FORMATS,
                        format => directories.map(
                  Severity: Minor
                  Found in server/local-files.js - About 1 hr to fix

                    Function createChart has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    const createChart = (canvas) => {
                      const context = canvas.getContext('2d');
                      
                      const lineGradient = context.createLinearGradient(0, 0, 0, 400);
                      lineGradient.addColorStop(0, 'rgb(80, 250, 123, 0.3)');   
                    Severity: Minor
                    Found in app/components/Equalizer/chart.js - About 1 hr to fix

                      Function ScrobblingReducer has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      export default function ScrobblingReducer(state=initialState, action) {
                        switch (action.type) {
                        case LASTFM_CONNECT:
                          return Object.assign({}, state, {
                            lastFmAuthToken: action.payload
                      Severity: Minor
                      Found in app/reducers/scrobbling.js - About 1 hr to fix

                        Function renderLastFmLoginButtons has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          renderLastFmLoginButtons () {
                            let {
                              lastFmAuthToken,
                              lastFmName,
                              lastFmSessionKey
                        Severity: Minor
                        Found in app/components/Settings/index.js - About 1 hr to fix

                          Function SearchReducer has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          export default function SearchReducer (state = initialState, action) {
                            switch (action.type) {
                            case UNIFIED_SEARCH_START:
                              return reduceUnifiedSearchStart(state, action);
                            case ALBUM_SEARCH_SUCCESS:
                          Severity: Minor
                          Found in app/reducers/search.js - About 1 hr to fix

                            Function exports has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            module.exports = env => {
                              let entry = env && env.LINUX ? './server/main.prod.linux.js' : './server/main.prod.js';
                            
                              return {
                                entry,
                            Severity: Minor
                            Found in webpack.config.electron.prod.js - About 1 hr to fix

                              Function render has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                render () {
                                  let {
                                    dashboardData,
                                    artistInfoSearchByName,
                                    albumInfoSearchByName,
                              Severity: Minor
                              Found in app/components/Dashboard/BestNewMusicTab/index.js - About 1 hr to fix

                                Function HelpModal has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                const HelpModal = () => {
                                  const [isOpen, setIsOpen] = useState(false);
                                  const handleOpen = useCallback(() => setIsOpen(true), []);
                                  const handleClose = useCallback(() => setIsOpen(false), []);
                                  const { t } = useTranslation('help');
                                Severity: Minor
                                Found in app/components/HelpModal/index.js - About 1 hr to fix

                                  Function renderQueueItems has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                    renderQueueItems() {
                                      if (!this.props.items) {
                                        return null;
                                      }
                                  
                                  
                                  Severity: Minor
                                  Found in app/components/PlayQueue/index.js - About 1 hr to fix

                                    Function renderTrigger has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                      renderTrigger (track) {
                                        const {
                                          displayCover,
                                          displayTrackNumber,
                                          displayArtist,
                                    Severity: Minor
                                    Found in app/components/TrackRow/index.js - About 1 hr to fix

                                      Function renderArtistHeader has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                        renderArtistHeader (artist, history) {
                                          return (
                                            <div className={styles.artist_header_overlay}>
                                              <div className={styles.artist_header_container}>
                                                <div
                                      Severity: Minor
                                      Found in app/components/ArtistView/index.js - About 1 hr to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language