adobe/brackets

View on GitHub
src/extensions/default/NavigationAndHistory/main.js

Summary

Maintainability
F
5 days
Test Coverage

File main.js has 562 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*
 * Copyright (c) 2016 - 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/extensions/default/NavigationAndHistory/main.js - About 1 day to fix

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

        function _createFileEntries($mrofList) {
            var data, fileEntry, $link, $newItem;
            // Iterate over the MROF list and create the pop over UI items
    
            // If we are in split view we might want to show the panes corresponding to the entries
    Severity: Minor
    Found in src/extensions/default/NavigationAndHistory/main.js - About 1 hr to fix

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

          function _createMROFDisplayList(refresh) {
              var $def = $.Deferred();
              
              var $mrofList, $link, $newItem;
      
      
      Severity: Minor
      Found in src/extensions/default/NavigationAndHistory/main.js - About 1 hr to fix

        Function _addDirectoriesForDuplicateBaseNames has 27 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            function _addDirectoriesForDuplicateBaseNames() {
                var checked = {}, baseName;
                // Find duplicates first
                $.map(_mrofList, function (value, index) {
                    baseName = FileUtils.getBaseName(value.file);
        Severity: Minor
        Found in src/extensions/default/NavigationAndHistory/main.js - About 1 hr to fix

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

              function _moveNext() {
                  var $context, $next;
          
                  $context = $currentContext || $("#mrof-container #mrof-list > li.highlight");
                  if ($context.length > 0) {
          Severity: Major
          Found in src/extensions/default/NavigationAndHistory/main.js and 1 other location - About 6 hrs to fix
          src/extensions/default/NavigationAndHistory/main.js on lines 519..536

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

          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 _movePrev() {
                  var $context, $prev;
          
                  $context = $currentContext || $("#mrof-container #mrof-list > li.highlight");
                  if ($context.length > 0) {
          Severity: Major
          Found in src/extensions/default/NavigationAndHistory/main.js and 1 other location - About 6 hrs to fix
          src/extensions/default/NavigationAndHistory/main.js on lines 479..496

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

          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 _cmdMoveNext() {
                  var $displayPromise;
                  if (!$mrofContainer) {
                      $displayPromise = _createMROFDisplayList();
                      $mrofContainer.addClass("confirmation-mode");
          Severity: Major
          Found in src/extensions/default/NavigationAndHistory/main.js and 1 other location - About 2 hrs to fix
          src/extensions/default/NavigationAndHistory/main.js on lines 538..553

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

          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 _cmdMovePrev() {
                  var $displayPromise;
                  if (!$mrofContainer) {
                      $displayPromise = _createMROFDisplayList();
                      $mrofContainer.addClass("confirmation-mode");
          Severity: Major
          Found in src/extensions/default/NavigationAndHistory/main.js and 1 other location - About 2 hrs to fix
          src/extensions/default/NavigationAndHistory/main.js on lines 498..513

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

          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 _detachListners() {
                  MainViewManager.off("workingSetMove.pane-first-pane", _handleWorkingSetMove);
                  MainViewManager.off("currentFileChange", handleCurrentFileChange);
                  MainViewManager.off("paneDestroy", _handlePaneMerge);
                  EditorManager.off("activeEditorChange", _handleActiveEditorChange);
          Severity: Major
          Found in src/extensions/default/NavigationAndHistory/main.js and 1 other location - About 1 hr to fix
          src/extensions/default/NavigationAndHistory/main.js on lines 798..804

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

          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 _attachListners() {
                  MainViewManager.on("workingSetMove.pane-first-pane", _handleWorkingSetMove);
                  MainViewManager.on("currentFileChange", handleCurrentFileChange);
                  MainViewManager.on("paneDestroy", _handlePaneMerge);
                  EditorManager.on("activeEditorChange", _handleActiveEditorChange);
          Severity: Major
          Found in src/extensions/default/NavigationAndHistory/main.js and 1 other location - About 1 hr to fix
          src/extensions/default/NavigationAndHistory/main.js on lines 806..812

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

          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

                          index = _.findIndex(_mrofList, function (record) {
                              return (record && record.file === value.file && record.paneId === targetPaneId);
                          });
          Severity: Minor
          Found in src/extensions/default/NavigationAndHistory/main.js and 1 other location - About 50 mins to fix
          src/extensions/default/NavigationAndHistory/main.js on lines 629..631

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

          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

                      tIndex = _.findIndex(_mrofList, function (record) {
                          return (record && record.file === file.fullPath && record.paneId === destinationPaneId);
                      });
          Severity: Minor
          Found in src/extensions/default/NavigationAndHistory/main.js and 1 other location - About 50 mins to fix
          src/extensions/default/NavigationAndHistory/main.js on lines 708..710

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

          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 index = _.findIndex(_mrofList, function (record) {
                      return (record && record.file === filePath && record.paneId === paneId);
                  });
          Severity: Minor
          Found in src/extensions/default/NavigationAndHistory/main.js and 1 other location - About 50 mins to fix
          src/extensions/default/NavigationAndHistory/main.js on lines 589..591

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

          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 index = _.findIndex(_mrofList, function (record) {
                      return (record && record.file === filePath && record.paneId === paneId);
                  });
          Severity: Minor
          Found in src/extensions/default/NavigationAndHistory/main.js and 1 other location - About 50 mins to fix
          src/extensions/default/NavigationAndHistory/main.js on lines 561..563

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

          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) {
                                          dirs[index] = dirSplit[0] + "/\u2026/" + dirSplit[dirSplit.length - 1];
                                      }
          Severity: Minor
          Found in src/extensions/default/NavigationAndHistory/main.js and 1 other location - About 45 mins to fix
          src/project/WorkingSetView.js on lines 1013..1015

          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

          There are no issues that match your filters.

          Category
          Status