adobe/brackets

View on GitHub
src/project/FileTreeView.js

Summary

Maintainability
F
4 days
Test Coverage

File FileTreeView.js has 783 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*
 * Copyright (c) 2014 - present Adobe Systems Incorporated. All rights reserved.
 *
 * Permission is hereby granted, free of charge, to any person obtaining a
 * copy of this software and associated documentation files (the "Software"),
Severity: Major
Found in src/project/FileTreeView.js - About 1 day to fix

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

            render: function () {
                var entry = this.props.entry,
                    nodeClass,
                    childNodes,
                    children = entry.get("children"),
    Severity: Major
    Found in src/project/FileTreeView.js - About 2 hrs to fix

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

              render: function () {
                  var selectionBackground = fileSelectionBox({
                      ref: "selectionBackground",
                      selectionViewInfo: this.props.selectionViewInfo,
                      className: "filetree-selection",
      Severity: Major
      Found in src/project/FileTreeView.js - About 2 hrs to fix

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

                render: function () {
                    var fullname = this.props.name,
                        extension = LanguageManager.getCompoundFileExtension(fullname),
                        name = _getName(fullname, extension);
        
        
        Severity: Minor
        Found in src/project/FileTreeView.js - About 1 hr to fix

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

                  render: function () {
                      var extensions = this.props.extensions,
                          iconClass = extensions && extensions.get("icons") ? "jstree-icons" : "jstree-no-icons",
                          ulProps = this.props.isRoot ? {
                              className: "jstree-brackets jstree-no-dots " + iconClass
          Severity: Minor
          Found in src/project/FileTreeView.js - About 1 hr to fix

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

                    componentDidUpdate: function () {
                        if (!this.props.visible) {
                            return;
                        }
            
            
            Severity: Minor
            Found in src/project/FileTreeView.js - About 1 hr to fix

              Function handleClick has 28 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      handleClick: function (e) {
                          // If we're renaming, allow the click to go through to the rename input.
                          if (this.props.entry.get("rename")) {
                              e.stopPropagation();
                              return;
              Severity: Minor
              Found in src/project/FileTreeView.js - About 1 hr to fix

                Function getIcons has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        getIcons: function () {
                            var result,
                                extensions = this.props.extensions;
                
                            if (extensions && extensions.get("icons")) {
                Severity: Minor
                Found in src/project/FileTreeView.js - About 1 hr to fix

                  Function render has 6 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                      function render(element, viewModel, projectRoot, actions, forceRender, platform) {
                  Severity: Minor
                  Found in src/project/FileTreeView.js - About 45 mins to fix

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

                                return nextProps.forceRender ||
                                    this.props.treeData !== nextProps.treeData ||
                                    this.props.sortDirectoriesFirst !== nextProps.sortDirectoriesFirst ||
                                    this.props.extensions !== nextProps.extensions ||
                                    this.props.selectionViewInfo !== nextProps.selectionViewInfo;
                    Severity: Major
                    Found in src/project/FileTreeView.js and 1 other location - About 1 hr to fix
                    src/project/FileTreeView.js on lines 791..795

                    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 66.

                    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

                                return nextProps.forceRender ||
                                    this.props.entry !== nextProps.entry ||
                                    this.props.sortDirectoriesFirst !== nextProps.sortDirectoriesFirst ||
                                    this.props.extensions !== nextProps.extensions ||
                                    (nextState !== undefined && this.state.draggedOver !== nextState.draggedOver);
                    Severity: Major
                    Found in src/project/FileTreeView.js and 1 other location - About 1 hr to fix
                    src/project/FileTreeView.js on lines 1144..1148

                    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 66.

                    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

                                    contextBackground = fileSelectionBox({
                                        ref: "contextBackground",
                                        selectionViewInfo: this.props.selectionViewInfo,
                                        className: "filetree-context",
                                        visible: this.props.selectionViewInfo.get("hasContext"),
                    Severity: Major
                    Found in src/project/FileTreeView.js and 1 other location - About 1 hr to fix
                    src/project/FileTreeView.js on lines 1165..1172

                    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 64.

                    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

                                var selectionBackground = fileSelectionBox({
                                    ref: "selectionBackground",
                                    selectionViewInfo: this.props.selectionViewInfo,
                                    className: "filetree-selection",
                                    visible: this.props.selectionViewInfo.get("hasSelection"),
                    Severity: Major
                    Found in src/project/FileTreeView.js and 1 other location - About 1 hr to fix
                    src/project/FileTreeView.js on lines 1173..1180

                    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 64.

                    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

                                    extensionForContext = selectionExtension({
                                        selectionViewInfo: this.props.selectionViewInfo,
                                        selectedClassName: ".context-node",
                                        visible: this.props.selectionViewInfo.get("hasContext"),
                                        forceUpdate: true,
                    Severity: Major
                    Found in src/project/FileTreeView.js and 1 other location - About 1 hr to fix
                    src/project/FileTreeView.js on lines 1181..1187

                    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 59.

                    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

                                    extensionForSelection = selectionExtension({
                                        selectionViewInfo: this.props.selectionViewInfo,
                                        selectedClassName: ".selected-node",
                                        visible: this.props.selectionViewInfo.get("hasSelection"),
                                        forceUpdate: true,
                    Severity: Major
                    Found in src/project/FileTreeView.js and 1 other location - About 1 hr to fix
                    src/project/FileTreeView.js on lines 1188..1194

                    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 59.

                    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

                            getDataForExtension: function () {
                                return {
                                    name: this.props.name,
                                    isFile: true,
                                    fullPath: this.myPath()
                    Severity: Minor
                    Found in src/project/FileTreeView.js and 1 other location - About 35 mins to fix
                    src/project/FileTreeView.js on lines 844..850

                    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 46.

                    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

                            getDataForExtension: function () {
                                return {
                                    name: this.props.name,
                                    isFile: false,
                                    fullPath: this.myPath()
                    Severity: Minor
                    Found in src/project/FileTreeView.js and 1 other location - About 35 mins to fix
                    src/project/FileTreeView.js on lines 597..603

                    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 46.

                    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

                    There are no issues that match your filters.

                    Category
                    Status