cnap-cobre/synapse

View on GitHub

Showing 129 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

    Similar blocks of code found in 3 locations. Consider refactoring.
    Open

    <FormGroup controlId="systemPublicKey">
    <Col componentClass={ControlLabel} sm={3}>
    Public Key*
    </Col>
    <Col sm={9}>
    frontend/src/components/AddSftpFileSystemForm/AddSftpFileSystemForm.js on lines 119..138
    frontend/src/components/AddSftpFileSystemForm/AddSftpFileSystemForm.js on lines 241..260

    Similar blocks of code found in 3 locations. Consider refactoring.
    Open

    <FormGroup controlId="systemPrivateKey">
    <Col componentClass={ControlLabel} sm={3}>
    Private Key*
    </Col>
    <Col sm={9}>
    frontend/src/components/AddSftpFileSystemForm/AddSftpFileSystemForm.js on lines 119..138
    frontend/src/components/AddSftpFileSystemForm/AddSftpFileSystemForm.js on lines 219..239

    Similar blocks of code found in 3 locations. Consider refactoring.
    Open

    <FormGroup controlId="systemDescription">
    <Col componentClass={ControlLabel} sm={3}>
    Description
    </Col>
    <Col sm={9}>
    frontend/src/components/AddSftpFileSystemForm/AddSftpFileSystemForm.js on lines 219..239
    frontend/src/components/AddSftpFileSystemForm/AddSftpFileSystemForm.js on lines 241..260

    Similar blocks of code found in 4 locations. Consider refactoring.
    Open

    <FormGroup controlId="systemName">
    <Col componentClass={ControlLabel} sm={3}>
    Name*
    </Col>
    <Col sm={9}>
    frontend/src/components/AddSftpFileSystemForm/AddSftpFileSystemForm.js on lines 79..97
    frontend/src/components/AddSftpFileSystemForm/AddSftpFileSystemForm.js on lines 140..158
    frontend/src/components/AddSftpFileSystemForm/AddSftpFileSystemForm.js on lines 160..178

    Similar blocks of code found in 4 locations. Consider refactoring.
    Open

    <FormGroup controlId="systemHost">
    <Col componentClass={ControlLabel} sm={3}>
    Host URL*
    </Col>
    <Col sm={9}>
    frontend/src/components/AddSftpFileSystemForm/AddSftpFileSystemForm.js on lines 79..97
    frontend/src/components/AddSftpFileSystemForm/AddSftpFileSystemForm.js on lines 99..117
    frontend/src/components/AddSftpFileSystemForm/AddSftpFileSystemForm.js on lines 140..158

    Similar blocks of code found in 4 locations. Consider refactoring.
    Open

    <FormGroup controlId="systemSite">
    <Col componentClass={ControlLabel} sm={3}>
    Site
    </Col>
    <Col sm={9}>
    frontend/src/components/AddSftpFileSystemForm/AddSftpFileSystemForm.js on lines 79..97
    frontend/src/components/AddSftpFileSystemForm/AddSftpFileSystemForm.js on lines 99..117
    frontend/src/components/AddSftpFileSystemForm/AddSftpFileSystemForm.js on lines 160..178

    Similar blocks of code found in 4 locations. Consider refactoring.
    Open

    <FormGroup controlId="systemId">
    <Col componentClass={ControlLabel} sm={3}>
    Id*
    </Col>
    <Col sm={9}>
    frontend/src/components/AddSftpFileSystemForm/AddSftpFileSystemForm.js on lines 99..117
    frontend/src/components/AddSftpFileSystemForm/AddSftpFileSystemForm.js on lines 140..158
    frontend/src/components/AddSftpFileSystemForm/AddSftpFileSystemForm.js on lines 160..178

    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';

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

          <Modal.Body>
          <p>
          Please enter a new name for this file:
          </p>
           
           
          Severity: Major
          Found in frontend/src/components/Modal/RenameFileModal.js and 1 other location - About 2 hrs to fix
          frontend/src/components/Modal/MakeDirectoryModal.js on lines 66..78

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

          <Modal.Body>
          <p>Please enter a name for the new folder:</p>
           
          <FormGroup>
          <FormControl
          Severity: Major
          Found in frontend/src/components/Modal/MakeDirectoryModal.js and 1 other location - About 2 hrs to fix
          frontend/src/components/Modal/RenameFileModal.js on lines 73..87

          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

                Identical blocks of code found in 2 locations. Consider refactoring.
                Open

                matchesFileSystem = (path) => {
                const { fileSystems } = this.props;
                 
                const matches = fileSystems.map(
                sys => path.indexOf(`${sys.provider}/${sys.id}`) !== -1,
                frontend/src/components/TabbedDirectoryBrowser/TabbedDirectoryBrowser.js on lines 29..35

                Identical blocks of code found in 2 locations. Consider refactoring.
                Open

                matchesFileSystem = (path) => {
                const { fileSystems } = this.props;
                const matches = fileSystems.map(
                sys => path.indexOf(`${sys.provider}/${sys.id}`) !== -1,
                );
                frontend/src/components/TabbedFileBrowser/TabbedFileBrowser.js on lines 110..117

                Identical blocks of code found in 2 locations. Consider refactoring.
                Open

                static propTypes = {
                showDotfiles: PropTypes.bool.isRequired,
                error: PropTypes.bool.isRequired,
                loading: PropTypes.bool.isRequired,
                list: PropTypes.array.isRequired,
                Severity: Major
                Found in frontend/src/components/FileBrowserList/FileBrowserList.js and 1 other location - About 2 hrs to fix
                frontend/src/components/FileBrowserGrid/FileBrowserGrid.js on lines 10..19

                Identical blocks of code found in 2 locations. Consider refactoring.
                Open

                static propTypes = {
                showDotfiles: PropTypes.bool.isRequired,
                error: PropTypes.bool.isRequired,
                loading: PropTypes.bool.isRequired,
                list: PropTypes.array.isRequired,
                Severity: Major
                Found in frontend/src/components/FileBrowserGrid/FileBrowserGrid.js and 1 other location - About 2 hrs to fix
                frontend/src/components/FileBrowserList/FileBrowserList.js on lines 8..17
                Severity
                Category
                Status
                Source
                Language