adobe/brackets

View on GitHub

Showing 3,294 of 3,294 total issues

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

    _stop: function( event, index ) {
        var uiHash = {
            handle: this.handles[ index ],
            value: this.value()
        };
src/extensions/default/JavaScriptQuickEdit/unittest-files/jquery-ui/ui/jquery.ui.slider.js on lines 410..421

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

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

File ServerUtils.js has 337 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*
 * Copyright (c) 2019 - present Adobe. 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: Minor
Found in src/languageTools/LanguageClient/ServerUtils.js - About 4 hrs to fix

    Function _renderItem has 102 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        ExtensionManagerView.prototype._renderItem = function (entry, info) {
            // Create a Mustache context object containing the entry data and our helper functions.
    
            // Start with the basic info from the given entry, either the installation info or the
            // registry info depending on what we're listing.
    Severity: Major
    Found in src/extensibility/ExtensionManagerView.js - About 4 hrs to fix

      Function _graphicsFilePresentInProject has 102 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          function _graphicsFilePresentInProject(isPresent) {
      
              if (!isPresent) {
                  return;
              }
      Severity: Major
      Found in src/extensions/default/OpenWithExternalApplication/GraphicsFile.js - About 4 hrs to fix

        Function getTagInfo has 102 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            function getTagInfo(editor, constPos, isHtmlMode) {
                // We're going to be changing pos a lot, but we don't want to mess up
                // the pos the caller passed in so we use extend to make a safe copy of it.
                var pos = $.extend({}, constPos),
                    ctx = TokenUtils.getInitialContext(editor._codeMirror, pos),
        Severity: Major
        Found in src/language/HTMLUtils.js - About 4 hrs to fix

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

                      _waitForJump(jumpPromise, function (newCursor) {
                          expect(newCursor.line).toBe(expectedLocation.line);
                          expect(newCursor.ch).toBe(expectedLocation.ch);
                          if (expectedLocation.file) {
                              var activeEditor = EditorManager.getActiveEditor();
          Severity: Major
          Found in src/extensions/default/PhpTooling/unittests.js and 2 other locations - About 4 hrs to fix
          src/extensions/default/JavaScriptCodeHints/unittests.js on lines 330..337
          src/extensions/default/JavaScriptQuickEdit/unittests.js on lines 441..448

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

          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 3 locations. Consider refactoring.
          Open

                      _waitForJump(jumpPromise, function (newCursor) {
                          expect(newCursor.line).toBe(expectedLocation.line);
                          expect(newCursor.ch).toBe(expectedLocation.ch);
                          if (expectedLocation.file) {
                              var activeEditor = EditorManager.getActiveEditor();
          Severity: Major
          Found in src/extensions/default/JavaScriptCodeHints/unittests.js and 2 other locations - About 4 hrs to fix
          src/extensions/default/JavaScriptQuickEdit/unittests.js on lines 441..448
          src/extensions/default/PhpTooling/unittests.js on lines 390..397

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

          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 3 locations. Consider refactoring.
          Open

                              _waitForJump(oldLocation, function (newCursor) {
                                  expect(newCursor.line).toBe(expectedLocation.line);
                                  expect(newCursor.ch).toBe(expectedLocation.ch);
                                  if (expectedLocation.file) {
                                      var activeEditor = EditorManager.getActiveEditor();
          Severity: Major
          Found in src/extensions/default/JavaScriptQuickEdit/unittests.js and 2 other locations - About 4 hrs to fix
          src/extensions/default/JavaScriptCodeHints/unittests.js on lines 330..337
          src/extensions/default/PhpTooling/unittests.js on lines 390..397

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

          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

                      self.errors.forEach(function (error) {
                          startLine = error.startPos.line;
                          endLine = error.endPos.line;
          
                          for (i = startLine; i < endLine + 1; i++) {
          src/LiveDevelopment/LiveDevelopment.js on lines 372..380

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

          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 (suffixIndented) {
                                  editGroup.push({text: "", start: {line: suffixPos.line, ch: 0}, end: {line: suffixPos.line + 1, ch: 0}});
                              } else if (prefixAtStart && suffixAtStart) {
                                  editGroup.push({text: "", start: suffixPos, end: {line: suffixPos.line + 1, ch: 0}});
                              } else {
          Severity: Major
          Found in src/editor/EditorCommandHandlers.js and 1 other location - About 4 hrs to fix
          src/editor/EditorCommandHandlers.js on lines 580..586

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

          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 (prefixIndented) {
                              editGroup.push({text: "", start: {line: prefixPos.line, ch: 0}, end: {line: prefixPos.line + 1, ch: 0}});
                          } else if (prefixAtStart && suffixAtStart) {
                              editGroup.push({text: "", start: prefixPos, end: {line: prefixPos.line + 1, ch: 0}});
                          } else {
          Severity: Major
          Found in src/editor/EditorCommandHandlers.js and 1 other location - About 4 hrs to fix
          src/editor/EditorCommandHandlers.js on lines 570..576

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

          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

                      liveDocument.errors.forEach(function (error) {
                          startLine = error.startPos.line;
                          endLine = error.endPos.line;
          
                          for (i = startLine; i < endLine + 1; i++) {
          Severity: Major
          Found in src/LiveDevelopment/LiveDevelopment.js and 1 other location - About 4 hrs to fix
          src/LiveDevelopment/MultiBrowserImpl/documents/LiveDocument.js on lines 223..231

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

          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 labelled has 101 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              blockstmt('switch', function () {
                  var t = nexttoken,
                      g = false;
                  funct['(breakage)'] += 1;
                  advance('(');

            File brackets.js has 335 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            /*
             * Copyright (c) 2012 - 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: Minor
            Found in src/brackets.js - About 4 hrs to fix

              File NavigationProvider.js has 334 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              /*
               * Copyright (c) 2017 - 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: Minor
              Found in src/extensions/default/NavigationAndHistory/NavigationProvider.js - About 4 hrs to fix

                Function addMenuItem has 100 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    Menu.prototype.addMenuItem = function (command, keyBindings, position, relativeID) {
                        var menuID = this.id,
                            id,
                            $menuItem,
                            menuItem,
                Severity: Major
                Found in src/command/Menus.js - About 4 hrs to fix

                  Consider simplifying this complex logical expression.
                  Open

                              if(!((l-d < x1 && x1 < r+d && t-d < y1 && y1 < b+d) || (l-d < x1 && x1 < r+d && t-d < y2 && y2 < b+d) || (l-d < x2 && x2 < r+d && t-d < y1 && y1 < b+d) || (l-d < x2 && x2 < r+d && t-d < y2 && y2 < b+d))) {
                                  if(inst.snapElements[i].snapping) (inst.options.snap.release && inst.options.snap.release.call(inst.element, event, $.extend(inst._uiHash(), { snapItem: inst.snapElements[i].item })));
                                  inst.snapElements[i].snapping = false;
                                  continue;
                              }

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

                        DOMUpdater.prototype._buildNodeMap = function (root) {
                            var nodeMap = {};
                    
                            function walk(node) {
                                if (node.tagID) {
                    Severity: Major
                    Found in src/language/HTMLInstrumentation.js and 1 other location - About 4 hrs to fix
                    src/LiveDevelopment/MultiBrowserImpl/language/HTMLInstrumentation.js on lines 377..391

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

                    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

                        DOMUpdater.prototype._buildNodeMap = function (root) {
                            var nodeMap = {};
                    
                            function walk(node) {
                                if (node.tagID) {
                    src/language/HTMLInstrumentation.js on lines 408..422

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

                    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 ($infoContent.length > 0) {
                                if ($infoContent[0].scrollWidth > $infoContent.innerWidth()) {
                                //Text has over-flown, show the info content as tooltip message
                                    if ($contentContainer.length > 0 &&
                                            $heading.length > 0 &&
                    Severity: Major
                    Found in src/widgets/infobar.js and 1 other location - About 4 hrs to fix
                    src/extensions/default/AutoUpdate/UpdateInfoBar.js on lines 111..120

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

                    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

                    Severity
                    Category
                    Status
                    Source
                    Language