matthew-matvei/freeman

View on GitHub

Showing 51 of 51 total issues

File DirectoryList.tsx has 424 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import autobind from "autobind-decorator";
import { remote } from "electron";
import { List } from "immutable";
import path from "path";
import * as PropTypes from "prop-types";
Severity: Minor
Found in src/renderer/components/panels/DirectoryList.tsx - About 6 hrs to fix

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

                                <DirectoryWrapper
                                    id="left"
                                    initialPath={os.homedir()}
                                    isSelectedPane={this.state.selectedPane === "left"}
                                    sendSelectedPaneUp={this.selectPane}
    Severity: Major
    Found in src/renderer/components/App.tsx and 1 other location - About 4 hrs to fix
    src/renderer/components/App.tsx on lines 92..102

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 122.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

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

                                <DirectoryWrapper
                                    id="right"
                                    initialPath={os.homedir()}
                                    isSelectedPane={this.state.selectedPane === "right"}
                                    sendSelectedPaneUp={this.selectPane}
    Severity: Major
    Found in src/renderer/components/App.tsx and 1 other location - About 4 hrs to fix
    src/renderer/components/App.tsx on lines 81..91

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 122.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    DirectoryList has 34 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class DirectoryList extends React.Component<IDirectoryListProps, IDirectoryListState> {
    
        /** Context available within a ScrollArea. */
        public context: { scrollArea: any };
    
    
    Severity: Minor
    Found in src/renderer/components/panels/DirectoryList.tsx - About 4 hrs to fix

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

              try {
                  const userTheme = this.directoryManager.readFileSync(fileName);
                  Utils.trace(`Retrieving user theme from ${fileName}`);
      
                  return JSON.parse(userTheme);
      Severity: Major
      Found in src/common/managers/ThemesManager.ts and 1 other location - About 2 hrs to fix
      src/common/managers/ConfigManager.ts on lines 34..43

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 84.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

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

              try {
                  const userKeys = this.directoryManager.readFileSync(fullPath);
                  Utils.trace(`Retrieving settings from ${fileName}`);
      
                  return JSON.parse(userKeys);
      Severity: Major
      Found in src/common/managers/ConfigManager.ts and 1 other location - About 2 hrs to fix
      src/common/managers/ThemesManager.ts on lines 83..92

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 84.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

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

          public render(): JSX.Element {
              const scrollAreaVertBarStyle: React.CSSProperties = {
                  backgroundColor: "rgb(65, 67, 57)"
              };
              const directoryListHeight = this.state.isTerminalOpen ?
      Severity: Major
      Found in src/renderer/components/wrappers/DirectoryWrapper.tsx - About 2 hrs to fix

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

                if (!this.validate(this.input!.value)) {
                    this.setState({ isInvalid: true } as IInputItemState);
        
                    return;
                } else {
        Severity: Major
        Found in src/renderer/components/blocks/InputItem.tsx and 1 other location - About 2 hrs to fix
        src/renderer/components/blocks/InputItem.tsx on lines 117..123

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 78.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

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

                if (!this.validate(this.input!.value)) {
                    this.setState({ isInvalid: true } as IInputItemState);
        
                    return;
                } else {
        Severity: Major
        Found in src/renderer/components/blocks/InputItem.tsx and 1 other location - About 2 hrs to fix
        src/renderer/components/blocks/InputItem.tsx on lines 142..148

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 78.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

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

            public render(): JSX.Element {
                const { directoryManager, keysManager, settingsManager, themeManager } = this.props;
                const appStyle = { color: themeManager.theme.primaryColour };
                const resizerStyle: React.CSSProperties = {
                    backgroundColor: this.props.themeManager.theme.resizers.colour
        Severity: Minor
        Found in src/renderer/components/App.tsx - About 1 hr to fix

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

              public render(): JSX.Element {
                  const { isSelected, model } = this.props;
                  const selectedClass = isSelected ? "selected" : "";
          
                  const {
          Severity: Minor
          Found in src/renderer/components/blocks/DirectoryItem.tsx - About 1 hr to fix

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

                            <button
                                className="createdOnColumn"
                                style={createdOnColumnStyle}
                                onClick={this.select}
                                onDoubleClick={this.activate}>
            Severity: Major
            Found in src/renderer/components/blocks/DirectoryItem.tsx and 1 other location - About 1 hr to fix
            src/renderer/components/blocks/DirectoryItem.tsx on lines 75..81

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 70.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

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

                            <button
                                className="lastModifiedColumn"
                                style={lastModifiedColumnStyle}
                                onClick={this.select}
                                onDoubleClick={this.activate}>
            Severity: Major
            Found in src/renderer/components/blocks/DirectoryItem.tsx and 1 other location - About 1 hr to fix
            src/renderer/components/blocks/DirectoryItem.tsx on lines 82..88

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 70.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

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

                private get itemStyles(): IDirectoryItemStyles {
                    const { isSelected, model, theme } = this.props;
                    const {
                        fileColour,
                        directoryColour,
            Severity: Minor
            Found in src/renderer/components/blocks/DirectoryItem.tsx - About 1 hr to fix

              Function listDirectory has 39 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public async listDirectory(
                      filePath: string,
                      options: IListDirectoryOptions
                  ): Promise<IDirectoryItem[]> {
              
              
              Severity: Minor
              Found in src/common/managers/DirectoryManager.ts - About 1 hr to fix

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

                    public render(): JSX.Element {
                        const directoryHeaderStyles: React.CSSProperties = {
                            background: this.props.theme.directoryHeader.backgroundColour,
                            boxShadow: `0 5px 5px ${this.props.theme.directoryItem.backgroundColour}`,
                            color: this.props.theme.directoryHeader.foregroundColour
                Severity: Minor
                Found in src/renderer/components/panels/DirectoryHeader.tsx - About 1 hr to fix

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

                                  this.setState(
                                      {
                                          directoryItems: await directoryManager.listDirectory(
                                              this.props.path,
                                              { hideUnixStyleHiddenItems: settingsManager.settings.windows.hideUnixStyleHiddenItems })
                  Severity: Major
                  Found in src/renderer/components/panels/DirectoryList.tsx and 2 other locations - About 1 hr to fix
                  src/renderer/components/panels/DirectoryList.tsx on lines 425..430
                  src/renderer/components/panels/DirectoryList.tsx on lines 441..446

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 60.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

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

                              this.setState(
                                  {
                                      directoryItems: await directoryManager.listDirectory(
                                          this.props.path,
                                          { hideUnixStyleHiddenItems: settingsManager.settings.windows.hideUnixStyleHiddenItems })
                  Severity: Major
                  Found in src/renderer/components/panels/DirectoryList.tsx and 2 other locations - About 1 hr to fix
                  src/renderer/components/panels/DirectoryList.tsx on lines 441..446
                  src/renderer/components/panels/DirectoryList.tsx on lines 549..554

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 60.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

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

                              this.setState(
                                  {
                                      directoryItems: await directoryManager.listDirectory(
                                          this.props.path,
                                          { hideUnixStyleHiddenItems: settingsManager.settings.windows.hideUnixStyleHiddenItems })
                  Severity: Major
                  Found in src/renderer/components/panels/DirectoryList.tsx and 2 other locations - About 1 hr to fix
                  src/renderer/components/panels/DirectoryList.tsx on lines 425..430
                  src/renderer/components/panels/DirectoryList.tsx on lines 549..554

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 60.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

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

                      @autobind
                      private async pasteFromClipboard() {
                          const { directoryManager, settingsManager } = this.props;
                          const { clipboardAction, clipboardItems } = this.model;
                  
                  
                  Severity: Minor
                  Found in src/renderer/components/panels/DirectoryList.tsx - About 1 hr to fix
                    Severity
                    Category
                    Status
                    Source
                    Language