nukeop/nuclear

View on GitHub

Showing 87 of 296 total issues

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

export const useTrackInfoProps = () => {
  const dispatch = useDispatch();
  const history = useHistory();
  const queue = useSelector(queueSelector);
  const hasTracks = queue.queueItems.length > 0;
Severity: Minor
Found in packages/app/app/containers/PlayerBarContainer/hooks.ts - About 1 hr to fix

    Function logEvent has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
    Open

      logEvent({ direction, event, data, once }: EventMessage) {
        const message = `${once ? 'once' : ''} ${direction === 'in' ? '==>' : '<=='} ${event}`;
    
        let dataMessage: string = typeof data;
    
    
    Severity: Minor
    Found in packages/main/src/services/logger/index.ts - 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 render has 35 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      render () {
        const {
          dashboardData,
          artistInfoSearchByName,
          albumInfoSearchByName,
    Severity: Minor
    Found in packages/app/app/components/Dashboard/BestNewMusicTab/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 packages/app/app/components/TrackRow/index.js - About 1 hr to fix

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

          renderAlbumInfoBox (album, albumImage) {
            return (
              <div className={styles.album_info_box}>
                <Img
                  src={albumImage}
        Severity: Minor
        Found in packages/app/app/components/AlbumView/index.js - About 1 hr to fix

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

          export default function (paths) {
          
            return next => (reducer, initialState, enhancer) => {
              if (typeof initialState === 'function' && typeof enhancer === 'undefined') {
                enhancer = initialState;
          Severity: Minor
          Found in packages/app/app/store/enhancers/syncStorage.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 packages/app/app/components/ArtistView/index.js - About 1 hr to fix

              Function createPopup has 33 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                createPopup() {
                  const {
                    url,
                    width,
                    height,
              Severity: Minor
              Found in packages/app/app/components/OauthPopup/index.js - About 1 hr to fix

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

                  render () {
                    const {
                      genres
                    } = this.props;
                
                
                Severity: Minor
                Found in packages/app/app/components/Dashboard/GenresTab/index.js - About 1 hr to fix

                  Function constructor has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    constructor(
                      @inject(Config) private config: Config,
                      @inject($mainLogger) private logger: Logger,
                      @inject($ipcLogger) private ipcLogger: Logger,
                      @inject(Platform) private platform: Platform,
                  Severity: Minor
                  Found in packages/main/src/services/window/index.ts - About 1 hr to fix

                    Function Toast has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    const Toast = props => {
                      return (
                        <div
                          className={cx(
                            common.nuclear,
                    Severity: Minor
                    Found in packages/ui/lib/components/ToastContainer/Toast/index.js - About 1 hr to fix

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

                        render() {
                          const {
                            searchActions,
                            queueActions,
                            playerActions,
                      Severity: Minor
                      Found in packages/app/app/containers/AlbumViewContainer/index.js - About 1 hr to fix

                        Function loadUserPlugin has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        export function loadUserPlugin(path) {
                          return async (dispatch, getState) => {
                            dispatch(loadUserPluginStart(path));
                            try {
                              const api = createApi();
                        Severity: Minor
                        Found in packages/app/app/actions/plugins.js - About 1 hr to fix

                          Function equalizerRouter has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          export function equalizerRouter(store: Store, rendererWindow: BrowserWindow['webContents']): ISwaggerizedRouter {
                            const router = express.Router() as ISwaggerizedRouter;
                          
                            swagger.swaggerize(router);
                          
                          
                          Severity: Minor
                          Found in packages/main/src/services/http/server/api/equalizer.ts - About 1 hr to fix

                            Function panes has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              panes () {
                                const panes = [
                                  {
                                    menuItem: 'All',
                                    render: () => this.renderAllResultsPane()
                            Severity: Minor
                            Found in packages/app/app/components/SearchResults/index.js - About 1 hr to fix

                              Function QueueReducer has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              export default function QueueReducer(state = initialState, action) {
                                switch (action.type) {
                                case ADD_QUEUE_ITEM:
                                  return {
                                    ...state,
                              Severity: Minor
                              Found in packages/app/app/reducers/queue.js - About 1 hr to fix

                                Function GithubReducer has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                export default function GithubReducer(state=initialState, action) {
                                  switch (action.type) {
                                  case GITHUB_OAUTH_ACCESS_TOKEN_SUCCESS:
                                    return Object.assign({}, state, {
                                      accessToken: action.payload.accessToken
                                Severity: Minor
                                Found in packages/app/app/reducers/github.js - About 1 hr to fix

                                  Function generateMdFile has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                  export const generateMdFile = (data: Record<string, Record<string, string[]>>) => {
                                    const stream = fs.createWriteStream(FILE_PATH, {
                                      encoding: 'utf-8'
                                    });
                                  
                                  
                                  Severity: Minor
                                  Found in packages/i18n/scripts/helpers/md.ts - About 1 hr to fix

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

                                          render() {
                                            return (
                                              <div
                                                style={{
                                                  background: '#282a36',
                                    Severity: Minor
                                    Found in packages/ui/stories/toasts.stories.js - About 1 hr to fix

                                      Function ImportFavsReducer has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                      export default function ImportFavsReducer(state=initialState, action) {
                                        switch (action.type) {
                                        case FAV_IMPORT_INIT:
                                          return Object.assign({}, state, {
                                            lastFmFavImportStatus: action.payload.lastFmFavImportStatus,
                                      Severity: Minor
                                      Found in packages/app/app/reducers/importfavs.js - About 1 hr to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language