adobe/brackets

View on GitHub

Showing 3,294 of 3,294 total issues

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

                SpecRunnerUtils.createTestWindowAndRun(this, function (w) {
                    testWindow          = w;
                    EditorManager       = testWindow.brackets.test.EditorManager;
                    CommandManager      = testWindow.brackets.test.CommandManager;
                    JSUtils             = testWindow.brackets.test.JSUtils;
Severity: Major
Found in src/extensions/default/JavaScriptQuickEdit/unittests.js and 1 other location - About 2 hrs to fix
src/extensions/default/JavaScriptQuickEdit/unittests.js on lines 541..546

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

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 EditorManager       = brackets.getModule("editor/EditorManager"),
        QuickOpen           = brackets.getModule("search/QuickOpen"),
        QuickOpenHelper     = brackets.getModule("search/QuickOpenHelper"),
        CSSUtils            = brackets.getModule("language/CSSUtils"),
        DocumentManager     = brackets.getModule("document/DocumentManager"),
Severity: Major
Found in src/extensions/default/QuickOpenCSS/main.js and 1 other location - About 2 hrs to fix
src/extensions/default/QuickOpenJavaScript/main.js on lines 27..32

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

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 cleanUpdateBar() {
        var $updateBar = $('#update-bar');
        if ($updateBar.length > 0) {
            $updateBar.remove();
        }
Severity: Major
Found in src/extensions/default/AutoUpdate/UpdateInfoBar.js and 1 other location - About 2 hrs to fix
src/widgets/infobar.js on lines 55..62

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

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 ExtensionManagerView.js has 264 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*
 * Copyright (c) 2013 - 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/extensibility/ExtensionManagerView.js - About 2 hrs to fix

    Consider simplifying this complex logical expression.
    Open

                            if ( forward && useCache ) {
                                // Seek `elem` from a previously-cached index
                                outerCache = parent[ expando ] || (parent[ expando ] = {});
                                cache = outerCache[ type ] || [];
                                nodeIndex = cache[0] === dirruns && cache[1];
    Severity: Critical
    Found in src/thirdparty/jquery-2.1.3.js - About 2 hrs to fix

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

      function init(domainManager) {
          _domainManager = domainManager;
          if (!domainManager.hasDomain("nodeSocketTransport")) {
              domainManager.registerDomain("nodeSocketTransport", {major: 0, minor: 1});
          }

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

            function _pointKeyDown(e) {
                var code = e.keyCode,
                    self = e.target,
                    bezierEditor = self.bezierEditor;
        
        

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

                domManip: function( args, callback ) {
            
                    // Flatten any nested arrays
                    args = concat.apply( [], args );
            
            
            Severity: Major
            Found in src/thirdparty/jquery-2.1.3.js - About 2 hrs to fix

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

                  function validateRequestParams(type, params) {
                      var validatedParams = null;
              
                      params = params || {};
              
              
              Severity: Major
              Found in src/languageTools/LanguageClientWrapper.js - About 2 hrs to fix

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

                    function _updateResults(doc, changeList) {
                        var i, diff, matches, lines, start, howMany,
                            resultsChanged = false,
                            fullPath       = doc.file.fullPath,
                            resultInfo     = searchModel.results[fullPath];
                Severity: Major
                Found in src/search/FindInFiles.js - About 2 hrs to fix

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

                      function _expandWordAndAddNextToSelection(editor, removePrimary) {
                          editor = editor || EditorManager.getActiveEditor();
                          if (!editor) {
                              return;
                          }
                  Severity: Major
                  Found in src/search/FindReplace.js - About 2 hrs to fix

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

                            function expectCursorAt(pos) {
                                var selection = testEditor.getSelection();
                                expect(fixPos(selection.start)).toEqual(fixPos(selection.end));
                                expect(fixPos(selection.start)).toEqual(fixPos(pos));
                            }
                    Severity: Major
                    Found in src/extensions/default/CSSPseudoSelectorHints/unittests.js and 2 other locations - About 2 hrs to fix
                    src/extensions/default/CSSAtRuleCodeHints/unittests.js on lines 97..101
                    src/extensions/default/HTMLCodeHints/unittests.js on lines 503..507

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

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

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

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

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

                    Refactorings

                    Further Reading

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

                            function expectCursorAt(pos) {
                                var selection = testEditor.getSelection();
                                expect(fixPos(selection.start)).toEqual(fixPos(selection.end));
                                expect(fixPos(selection.start)).toEqual(fixPos(pos));
                            }
                    Severity: Major
                    Found in src/extensions/default/CSSAtRuleCodeHints/unittests.js and 2 other locations - About 2 hrs to fix
                    src/extensions/default/CSSPseudoSelectorHints/unittests.js on lines 103..107
                    src/extensions/default/HTMLCodeHints/unittests.js on lines 503..507

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

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

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

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

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

                    Refactorings

                    Further Reading

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

                                function expectCursorAt(pos) {
                                    var selection = testEditor.getSelection();
                                    expect(fixPos(selection.start)).toEqual(fixPos(selection.end));
                                    expect(fixPos(selection.start)).toEqual(fixPos(pos));
                                }
                    Severity: Major
                    Found in src/extensions/default/HTMLCodeHints/unittests.js and 2 other locations - About 2 hrs to fix
                    src/extensions/default/CSSAtRuleCodeHints/unittests.js on lines 97..101
                    src/extensions/default/CSSPseudoSelectorHints/unittests.js on lines 103..107

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

                    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

                        ParameterHintsProvider.prototype.hasParameterHints = function (editor, implicitChar) {
                            if (!this.client) {
                                return false;
                            }
                    
                    
                    Severity: Major
                    Found in src/languageTools/DefaultProviders.js and 1 other location - About 2 hrs to fix
                    src/languageTools/DefaultProviders.js on lines 96..107

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

                    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

                                xit("should read methods created in submodule", function () {
                                    var start = { line: 19, ch: 15 };
                    
                                    runs(function () {
                                        testEditor.setCursorPos(start);
                    Severity: Major
                    Found in src/extensions/default/JavaScriptCodeHints/unittests.js and 2 other locations - About 2 hrs to fix
                    src/extensions/default/JavaScriptCodeHints/unittests.js on lines 1467..1475
                    src/extensions/default/JavaScriptCodeHints/unittests.js on lines 1772..1780

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

                    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

                                it("should read methods created in submodule on this", function () {
                                    var start = { line: 8, ch: 17 };
                    
                                    runs(function () {
                                        testEditor.setCursorPos(start);
                    Severity: Major
                    Found in src/extensions/default/JavaScriptCodeHints/unittests.js and 2 other locations - About 2 hrs to fix
                    src/extensions/default/JavaScriptCodeHints/unittests.js on lines 1478..1486
                    src/extensions/default/JavaScriptCodeHints/unittests.js on lines 1772..1780

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

                    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

                        CodeHintsProvider.prototype.hasHints = function (editor, implicitChar) {
                            if (!this.client) {
                                return false;
                            }
                    
                    
                    Severity: Major
                    Found in src/languageTools/DefaultProviders.js and 1 other location - About 2 hrs to fix
                    src/languageTools/DefaultProviders.js on lines 210..221

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

                    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

                        CSSPreprocessorDocument.prototype.close = function close() {
                            this.doc.off(".CSSPreprocessorDocument");
                            EditorManager.off("activeEditorChange", this.onActiveEditorChange);
                            this.doc.releaseRef();
                            this.detachFromEditor();
                    Severity: Major
                    Found in src/LiveDevelopment/Documents/CSSPreprocessorDocument.js and 1 other location - About 2 hrs to fix
                    src/LiveDevelopment/Documents/CSSDocument.js on lines 127..132

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

                    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