cnap-cobre/synapse

View on GitHub

Showing 44 of 129 total issues

File ContextMenu.js has 337 lines of code (exceeds 250 allowed). Consider refactoring.
Open

// @flow
import { connect } from 'react-redux';
import EventListener from 'react-event-listener';
import React from 'react';
import { addModal } from '../../store/ui/modals/Modals';
Severity: Minor
Found in frontend/src/components/ContextMenu/ContextMenu.js - About 4 hrs to fix

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

    render() {
    const { empty, files } = this.props;
     
    if (empty) {
    return (
    Severity: Major
    Found in frontend/src/components/FileMetadata/FileMetadata.js - About 3 hrs to fix

      Function ModalWrapper has 74 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      const ModalWrapper = (props: Props) => {
      const { modals } = props;
      console.log(modals);
       
      return (
      Severity: Major
      Found in frontend/src/components/Modal/ModalWrapper.js - About 2 hrs to fix

        File AddSftpFileSystemForm.js has 288 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        // @flow
         
        import Button from 'react-bootstrap/lib/Button';
        import Col from 'react-bootstrap/lib/Col';
        import { connect } from 'react-redux';

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

          render() {
          return (
          <DefaultLayout>
          <div className="content">
          <div className="container-fluid">
          Severity: Major
          Found in frontend/src/pages/Files/FileSystems/FileSystems.js - About 2 hrs to fix

            Function fileSystems has 53 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export default function fileSystems(state = initialFileSystemsState, action) {
            const nonAgaveSystems = state.systems.filter(
            sys => sys.provider !== 'agave',
            );
            const nonDropboxSystems = state.systems.filter(
            Severity: Major
            Found in frontend/src/store/fileSystems/reducer.js - About 2 hrs to fix

              Function visualOptions has 52 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              export default function visualOptions(state = initialVisualOptionsState, action) {
              switch (action.type) {
              // ---------
              // Dotfiles
              // ---------
              Severity: Major
              Found in frontend/src/store/ui/visualOptions/reducer.js - About 2 hrs to fix

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

                render() {
                const {
                system,
                systemPrefix,
                pathname,
                Severity: Minor
                Found in frontend/src/components/FileBrowser/FileBrowser.js - About 1 hr to fix

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

                  render() {
                  const {
                  isReady, fileSystems, dispatch, prefix, browserPaths,
                  } = this.props;
                   
                   
                  Severity: Minor
                  Found in frontend/src/components/TabbedFileBrowser/TabbedFileBrowser.js - About 1 hr to fix

                    Function BootstrapSwitch has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    const BootstrapSwitch = (props: Props) => {
                    const {
                    style, enabledColor, disabledColor, enabledLabel, disabledLabel, enabled, onToggleClick,
                    } = props;
                     
                     
                    Severity: Minor
                    Found in frontend/src/components/BootstrapSwitch/BootstrapSwitch.js - About 1 hr to fix

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

                      const uploadFile = (csrftoken, file, path) => {
                      const UPLOAD_FILE_SIZE_LIMIT = 150 * 1024 * 1024;
                      const db = dbx(csrftoken);
                      const trimmedPath = path.slice('/dropbox/home'.length);
                       
                       
                      Severity: Minor
                      Found in frontend/src/services/Dropbox/dropboxFileActions.js - About 1 hr to fix

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

                        export default function browserPaths(state = initialBrowserPathsState, action) {
                        switch (action.type) {
                        case agaveFileSystemsTypes.GET_AGAVE_FILE_SYSTEMS_ASYNC.SUCCESS: {
                        const keysFromAction = action.systems.reduce((acc, cv) => {
                        acc[`${cv.provider}.${cv.id}`] = ['', cv.provider, cv.id, ''].join('/');
                        Severity: Minor
                        Found in frontend/src/store/ui/browserPaths/reducer.js - About 1 hr to fix

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

                          const FileBrowserControls = (props: Props) => {
                          const {
                          handleRefresh, id, showDotfiles, toggleDotfiles, path,
                          } = props;
                           
                           
                          Severity: Minor
                          Found in frontend/src/components/FileBrowserControls/FileBrowserControls.js - About 1 hr to fix

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

                            render() {
                            const folders = this.props.list.filter(
                            (item, i) => ((this.props.showDotfiles || !item.name.match(/^\./i)) && item.type === 'dir'),
                            );
                             
                             
                            Severity: Minor
                            Found in frontend/src/components/FileBrowserGrid/FileBrowserGrid.js - About 1 hr to fix

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

                              export default function SecondaryNavigation() {
                              return (
                              <ul className="nav navbar-nav navbar-right">
                              <li>
                              <a href="#stats" className="dropdown-toggle btn-magnify" data-toggle="dropdown">
                              Severity: Minor
                              Found in frontend/src/components/SecondaryNavigation/SecondaryNavigation.js - About 1 hr to fix

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

                                const DirectoryBrowser = (props: Props) => {
                                const {
                                style, error, loading, list, handleDoubleClick,
                                } = props;
                                 
                                 
                                Severity: Minor
                                Found in frontend/src/components/DirectoryBrowser/DirectoryBrowser.js - About 1 hr to fix

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

                                  render() {
                                  return (
                                  <div className="user">
                                  <div className="info">
                                  <div className="photo">
                                  Severity: Minor
                                  Found in frontend/src/components/UserDropdown/UserDropdown.js - About 1 hr to fix

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

                                    const systemUrlResolverAndRedirector = (props) => {
                                    if (props.pathname.indexOf(props.prefix) !== 0) {
                                    return 0;
                                    }
                                     
                                     
                                    Severity: Minor
                                    Found in frontend/src/components/TabbedFileBrowser/TabbedFileBrowser.js - About 1 hr to fix

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

                                      const HistoryMetadata = (props: Props) => {
                                      const { singleSelected, loading, history } = props;
                                       
                                      if (!singleSelected) {
                                      return (
                                      Severity: Minor
                                      Found in frontend/src/components/HistoryMetadata/HistoryMetadata.js - About 1 hr to fix

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

                                        render() {
                                        return (
                                        <DefaultLayout>
                                        <div className="content fileContent">
                                        <div className="container-fluid">
                                        Severity: Minor
                                        Found in frontend/src/pages/Files/Browse/Browse.js - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language