adobe/brackets

View on GitHub

Showing 3,294 of 3,294 total issues

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

            enabledProviders.some(function (item, index) {
                if (item.provider.canJumpToDef(editor)) {
                    jumpToDefProvider = item.provider;
                    return true;
                }
Severity: Minor
Found in src/features/JumpToDefManager.js and 1 other location - About 50 mins to fix
src/features/FindReferencesManager.js on lines 83..88

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

            it("should not trigger CSS property name hints with space key", function () {
                testEditor.setCursorPos({ line: 25, ch: 11 });    // after {
                expectNoHints(CSSCodeHints.cssPropHintProvider, " ");
            });
Severity: Minor
Found in src/extensions/default/CSSCodeHints/unittests.js and 1 other location - About 50 mins to fix
src/extensions/default/CSSCodeHints/unittests.js on lines 861..864

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

        _validateFrame(navFrame).done(function () {
            jumpBackwardStack.push(navFrame);
            navFrame.goTo();
            currentEditPos = navFrame;
        }).fail(function () {
src/extensions/default/NavigationAndHistory/NavigationProvider.js on lines 361..367

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

            it("should not trigger CSS property value hints with space key", function () {
                testEditor.setCursorPos({ line: 28, ch: 21 });    // after flow-from
                expectNoHints(CSSCodeHints.cssPropHintProvider, " ");
            });
Severity: Minor
Found in src/extensions/default/CSSCodeHints/unittests.js and 1 other location - About 50 mins to fix
src/extensions/default/CSSCodeHints/unittests.js on lines 856..859

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

    infix('---', function (left) {
        warning("Confusing minuses.");
        this.left = left;
        this.right = expression(130);
        return this;
src/extensions/default/JavaScriptQuickEdit/unittest-files/jquery-ui/external/jshint.js on lines 2887..2892

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

        enabledProviders.some(function (item, index) {
            if (item.provider.hasHints(editor, lastChar)) {
                sessionProvider = item.provider;
                return true;
            }
Severity: Minor
Found in src/editor/CodeHintManager.js and 1 other location - About 50 mins to fix
src/features/ParameterHintsManager.js on lines 266..271

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 (fileNames) {
                for (i = 0, l = fileNames.length; i < l; i++) {
                    language.addFileName(fileNames[i]);
                }
            }
Severity: Minor
Found in src/language/LanguageManager.js and 1 other location - About 50 mins to fix
src/language/LanguageManager.js on lines 948..952

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

        if (!this.$selection.find(".selector-base").is(":focus")) {
            this.$selection.find(".selector-base").focus();
        }
Severity: Major
Found in src/extensions/default/InlineColorEditor/ColorEditor.js and 2 other locations - About 50 mins to fix
src/extensions/default/InlineColorEditor/ColorEditor.js on lines 573..575
src/extensions/default/InlineColorEditor/ColorEditor.js on lines 585..587

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

        if (!this.$opacitySlider.find(".selector-base").is(":focus")) {
            this.$opacitySlider.find(".selector-base").focus();
        }
Severity: Major
Found in src/extensions/default/InlineColorEditor/ColorEditor.js and 2 other locations - About 50 mins to fix
src/extensions/default/InlineColorEditor/ColorEditor.js on lines 561..563
src/extensions/default/InlineColorEditor/ColorEditor.js on lines 573..575

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

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

    function _isPrevTokenABlockComment(ctx, prefix, suffix, prefixExp, suffixExp, lineExp) {
Severity: Minor
Found in src/editor/EditorCommandHandlers.js - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                        } else if (i + 1 === n) {
                            // look for a comma after the node.end. This will tell us we
                            // are on the next argument, even there is no text, and therefore no node,
                            // for the next argument.
                            text = fragment.substring(node.end, offset);
    Severity: Major
    Found in src/JSUtils/Session.js - About 45 mins to fix

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

      function _cmdInstall(packagePath, destinationDirectory, options, callback, pCallback, _doUpdate) {
      Severity: Minor
      Found in src/extensibility/node/ExtensionManagerDomain.js - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                                if (text.indexOf(",") >= (offset - lastEnd)) {
                                    // comma is after the offset so the current arg is the
                                    // previous arg node.
                                    i--;
                                } else if (i === 0 && text.indexOf("(") !== -1) {
        Severity: Major
        Found in src/JSUtils/Session.js - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                                      if (sel.end.line === totalLines - 1) {
                                          nextText += "\n";
                                      }
          Severity: Major
          Found in src/editor/EditorCommandHandlers.js - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                            if (!voidElements.hasOwnProperty(closeTagName)) {
                                // Find the topmost item on the stack that matches. If we can't find one, assume
                                // this is just a dangling closing tag and ignore it.
                                var i;
                                for (i = stack.length - 1; i >= 0; i--) {
            Severity: Major
            Found in src/LiveDevelopment/MultiBrowserImpl/language/HTMLSimpleDOM.js - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                          } else if (token.type === "attribname") {
                              attributeName = token.contents.toLowerCase();
                              // Set the value to the empty string in case this is an empty attribute. If it's not,
                              // it will get overwritten by the attribvalue later.
                              this.currentTag.attributes[attributeName] = "";
              Severity: Major
              Found in src/LiveDevelopment/MultiBrowserImpl/language/HTMLSimpleDOM.js - About 45 mins to fix

                Function ConsoleAgent has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                Open

                define(function ConsoleAgent(require, exports, module) {
                    "use strict";
                
                    var Inspector = require("LiveDevelopment/Inspector/Inspector");
                
                
                Severity: Minor
                Found in src/LiveDevelopment/Agents/ConsoleAgent.js - About 45 mins to fix

                Cognitive Complexity

                Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                A method's cognitive complexity is based on a few simple rules:

                • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                • Code is considered more complex for each "break in the linear flow of the code"
                • Code is considered more complex when "flow breaking structures are nested"

                Further reading

                Avoid deeply nested control flow statements.
                Open

                                    if (token.type === "selfclosingtag" && stack.length && stack[stack.length - 1] === this.currentTag) {
                                        // This must have been a self-closing tag that we didn't identify as a void element
                                        // (e.g. an SVG tag). Pop it off the stack as if we had encountered its close tag.
                                        closeTag(token.end, token.endPos);
                                    } else {
                Severity: Major
                Found in src/LiveDevelopment/MultiBrowserImpl/language/HTMLSimpleDOM.js - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                                          if (param.value < 0) {
                                              match[i] = "0";
                                          } else if (param.value > 1) {
                                              match[i] = "1";
                                          }
                  Severity: Major
                  Found in src/extensions/default/InlineTimingFunctionEditor/TimingFunctionUtils.js - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                            if (tag[0] === "#" || tag[0] === "~" || tag[0] === "^") {
                                                tagStack.push(tag.substr(1));
                                            } else if (tag[0] === "/" &&
                                                       (_.last(tagStack) === tag.substr(1) || _.last(tagStack) === "*" + tag.substr(1))) {
                                                tagStack.pop();
                    Severity: Major
                    Found in src/extensions/default/CodeFolding/foldhelpers/handlebarsFold.js - About 45 mins to fix
                      Severity
                      Category
                      Status
                      Source
                      Language