adobe/brackets

View on GitHub
src/project/WorkingSetView.js

Summary

Maintainability
F
1 wk
Test Coverage

File WorkingSetView.js has 890 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/WorkingSetView.js - About 2 days to fix

    Function _makeDraggable has 426 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        function _makeDraggable($el) {
            var interval,
                sourceFile = $el.data(_FILE_KEY);
    
            // turn off the "hover-scroll"
    Severity: Major
    Found in src/project/WorkingSetView.js - About 2 days to fix

      Function hitTest has 194 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

                  function hitTest(e) {
                      var pageY = $ghost.offset().top,
                          direction =  e.pageY - lastPageY,
                          result = {
                              where: NOMANSLAND
      Severity: Major
      Found in src/project/WorkingSetView.js - About 7 hrs to fix

        Function drag has 58 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                        function drag(e) {
                            if (!dragged) {
                                initDragging();
                                // sort redraw and scroll shadows
                                //  cause problems during drag so disable them
        Severity: Major
        Found in src/project/WorkingSetView.js - About 2 hrs to fix

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

                      function drop() {
                          preDropCleanup();
                          if (sourceView.paneId === currentView.paneId && startingIndex === $el.index()) {
                              // if the item was dragged but not moved then don't open or close
                              if (!dragged) {
          Severity: Minor
          Found in src/project/WorkingSetView.js - About 1 hr to fix

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

                WorkingSetView.prototype._createNewListItem = function (file) {
                    var self = this,
                        selectedFile = MainViewManager.getCurrentlyViewedFile(this.paneId),
                        data = {fullPath: file.fullPath,
                                name: file.name,
            Severity: Minor
            Found in src/project/WorkingSetView.js - About 1 hr to fix

              Avoid deeply nested control flow statements.
              Open

                                      if ($next.length) {
                                          result = {
                                              where: ABOVEVIEW,
                                              which: $next
                                          };
              Severity: Major
              Found in src/project/WorkingSetView.js - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                                            if (ghostIsBelow($hit)) {
                                                return result;
                                            }
                Severity: Major
                Found in src/project/WorkingSetView.js - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                                      } else if (mouseIsInTopHalf($view)) {
                                          // we're inside the top half of
                                          //  a view so prepend to the view we hit
                                          result = {
                                              where: ABOVEVIEW,
                  Severity: Major
                  Found in src/project/WorkingSetView.js - About 45 mins to fix

                    Avoid too many return statements within this function.
                    Open

                                    return result;
                    Severity: Major
                    Found in src/project/WorkingSetView.js - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                                              return result;
                      Severity: Major
                      Found in src/project/WorkingSetView.js - About 30 mins to fix

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

                                        function ghostIsAbove($elem) {
                                            var top = $elem.offset().top,
                                                checkVal = gTop;
                        
                                            if (direction > 0) {
                        Severity: Major
                        Found in src/project/WorkingSetView.js and 1 other location - About 1 hr to fix
                        src/project/WorkingSetView.js on lines 448..457

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

                        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

                                        function ghostIsBelow($elem) {
                                            var top = $elem.offset().top,
                                                checkVal = gTop;
                        
                                            if (direction > 0) {
                        Severity: Major
                        Found in src/project/WorkingSetView.js and 1 other location - About 1 hr to fix
                        src/project/WorkingSetView.js on lines 437..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 65.

                        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

                                        onBottomScroller = hasScroller && scrollerBottomArea && ((gTop >= scrollerBottomArea.top && gTop <= scrollerBottomArea.bottom) ||
                                                                                 (gBottom >= scrollerBottomArea.top && gBottom <= scrollerBottomArea.bottom));
                        Severity: Major
                        Found in src/project/WorkingSetView.js and 1 other location - About 1 hr to fix
                        src/project/WorkingSetView.js on lines 423..424

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

                        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

                                        onTopScroller = hasScroller && scrollerTopArea && ((gTop >= scrollerTopArea.top && gTop <= scrollerTopArea.bottom)  ||
                                                                            (gBottom >= scrollerTopArea.top && gBottom <= scrollerTopArea.bottom));
                        Severity: Major
                        Found in src/project/WorkingSetView.js and 1 other location - About 1 hr to fix
                        src/project/WorkingSetView.js on lines 425..426

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

                        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

                                                            CommandManager
                                                                .execute(Commands.FILE_OPEN, {fullPath: sourceFile.fullPath,
                                                                                               paneId: currentView.paneId})
                                                                .always(function () {
                                                                    postDropCleanup();
                        Severity: Minor
                        Found in src/project/WorkingSetView.js and 1 other location - About 55 mins to fix
                        src/project/WorkingSetView.js on lines 777..782

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

                        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

                                                    CommandManager
                                                        .execute(Commands.FILE_OPEN, {fullPath: sourceFile.fullPath,
                                                                                       paneId: currentView.paneId})
                                                        .always(function () {
                                                            postDropCleanup();
                        Severity: Minor
                        Found in src/project/WorkingSetView.js and 1 other location - About 55 mins to fix
                        src/project/WorkingSetView.js on lines 801..806

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

                        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

                                        if (dirSplit.length > 3) {
                                            displayPaths[io] = dirSplit[0] + "/\u2026/" + dirSplit[dirSplit.length - 1];
                                        }
                        Severity: Minor
                        Found in src/project/WorkingSetView.js and 1 other location - About 45 mins to fix
                        src/extensions/default/NavigationAndHistory/main.js on lines 222..224

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

                        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

                                _iconProviders.forEach(function (provider) {
                                    var icon = provider(data);
                                    if (icon) {
                                        $link.prepend($(icon));
                                    }
                        Severity: Minor
                        Found in src/project/WorkingSetView.js and 1 other location - About 45 mins to fix
                        src/project/WorkingSetView.js on lines 1481..1486

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

                        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

                                _iconProviders.forEach(function (provider) {
                                    var icon = provider(data);
                                    if (icon) {
                                        $element.prepend($(icon));
                                    }
                        Severity: Minor
                        Found in src/project/WorkingSetView.js and 1 other location - About 45 mins to fix
                        src/project/WorkingSetView.js on lines 1140..1145

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

                        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

                                    files.forEach(function (file) {
                                        var $listItem = self._findListItemFromFile(file);
                                        if ($listItem) {
                                            $listItem.remove();
                                        }
                        Severity: Minor
                        Found in src/project/WorkingSetView.js and 1 other location - About 40 mins to fix
                        src/extensions/default/NoDistractions/main.js on lines 94..99

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

                        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