adobe/brackets

View on GitHub

Showing 3,294 of 3,294 total issues

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

            it("should extract super expression", function () {
                testEditor.setSelection({line: 103, ch: 8}, {line: 103, ch: 29});

                var prevDocLength = testDoc.getText().length;

Severity: Major
Found in src/extensions/default/JavaScriptRefactoring/unittests.js and 2 other locations - About 3 hrs to fix
src/extensions/default/JavaScriptRefactoring/unittests.js on lines 202..212
src/extensions/default/JavaScriptRefactoring/unittests.js on lines 305..315

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

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

    trigger: function( event, data, elem, onlyHandlers ) {
        // Don't do events on text and comment nodes
        if ( elem && (elem.nodeType === 3 || elem.nodeType === 8) ) {
            return;
        }

    Function animate has 94 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        animate: function( prop, speed, easing, callback ) {
            var optall = jQuery.speed( speed, easing, callback );
    
            if ( jQuery.isEmptyObject( prop ) ) {
                return this.each( optall.complete, [ false ] );

      File FileFilters.js has 323 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      /*
       * Copyright (c) 2014 - present Adobe Systems Incorporated. All rights reserved.
       *
       * Permission is hereby granted, free of charge, to any person obtaining a
       * copy of this software and associated documentation files (the "Software"),
      Severity: Minor
      Found in src/search/FileFilters.js - About 3 hrs to fix

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

                    it("should insert if query is empty", function () {
                        // After < inside <g>
                        testDocument.replaceRange("<", { line: 7, ch: 8});
                        testEditor.setCursorPos({line: 7, ch: 9});
                        selectHint(SVGCodeHints.hintProvider, "a");
        Severity: Major
        Found in src/extensions/default/SVGCodeHints/unittests.js and 2 other locations - About 3 hrs to fix
        src/extensions/default/SVGCodeHints/unittests.js on lines 507..514
        src/extensions/default/SVGCodeHints/unittests.js on lines 516..523

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

        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 insert if query is complete", function () {
                        // After <defs inside <g>
                        testDocument.replaceRange("<defs", {line: 7, ch: 8});
                        testEditor.setCursorPos({line: 7, ch: 13});
                        selectHint(SVGCodeHints.hintProvider, "defs");
        Severity: Major
        Found in src/extensions/default/SVGCodeHints/unittests.js and 2 other locations - About 3 hrs to fix
        src/extensions/default/SVGCodeHints/unittests.js on lines 498..505
        src/extensions/default/SVGCodeHints/unittests.js on lines 507..514

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

        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 insert if query is one character long", function () {
                        // After <d inside <g>
                        testDocument.replaceRange("<d", {line: 7, ch: 8});
                        testEditor.setCursorPos({line: 7, ch: 10});
                        selectHint(SVGCodeHints.hintProvider, "defs");
        Severity: Major
        Found in src/extensions/default/SVGCodeHints/unittests.js and 2 other locations - About 3 hrs to fix
        src/extensions/default/SVGCodeHints/unittests.js on lines 498..505
        src/extensions/default/SVGCodeHints/unittests.js on lines 516..523

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

        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 convert step-start function to steps function parameters", function () {
                            runs(function () {
                                makeTimingFuncUI("step-start");
                                expect(timingFuncEditor).toBeTruthy();
                                expect(timingFuncEditor._stepParams).toBeTruthy();
        src/extensions/default/InlineTimingFunctionEditor/unittests.js on lines 543..551

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

        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

                        co.top+(over ? Math.max(ce.scrollHeight,ce.offsetHeight) : ce.offsetHeight) - (parseInt($(ce).css("borderTopWidth"),10) || 0) - (parseInt($(ce).css("paddingBottom"),10) || 0) - this.helperProportions.height - this.margins.top
        src/extensions/default/JavaScriptQuickEdit/unittest-files/jquery-ui/ui/jquery.ui.sortable.js on lines 872..872

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

        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 load the initial steps function correctly", function () {
                            runs(function () {
                                makeTimingFuncUI("steps(5, start)");
                                expect(timingFuncEditor).toBeTruthy();
                                expect(timingFuncEditor._stepParams).toBeTruthy();
        src/extensions/default/InlineTimingFunctionEditor/unittests.js on lines 595..603

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

        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

                        co.left+(over ? Math.max(ce.scrollWidth,ce.offsetWidth) : ce.offsetWidth) - (parseInt($(ce).css("borderLeftWidth"),10) || 0) - (parseInt($(ce).css("paddingRight"),10) || 0) - this.helperProportions.width - this.margins.left,
        src/extensions/default/JavaScriptQuickEdit/unittest-files/jquery-ui/ui/jquery.ui.sortable.js on lines 873..873

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

        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 NodeConnection.js has 322 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/utils/NodeConnection.js - About 3 hrs to fix

          Function RemoteAgent has 93 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          define(function RemoteAgent(require, exports, module) {
              "use strict";
          
              var LiveDevelopment     = require("LiveDevelopment/LiveDevelopment"),
                  EventDispatcher     = require("utils/EventDispatcher"),
          Severity: Major
          Found in src/LiveDevelopment/Agents/RemoteAgent.js - About 3 hrs to fix

            Function getHintResponse has 93 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                function getHintResponse(hints, query, type) {
            
                    var trimmedQuery,
                        formattedHints;
            
            
            Severity: Major
            Found in src/extensions/default/JavaScriptCodeHints/main.js - About 3 hrs to fix

              Function _create has 93 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  _create: function() {
              
                      var that = this, o = this.options;
                      this.element.addClass("ui-resizable");
              
              

                Function extract has 93 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    function extract(ast, text, scopes, srcScope, destScope, start, end, isExpression) {
                        var retObj               = analyzeCode(text, scopes, srcScope, destScope, start, end),
                            passParams           = retObj.passParams,
                            retParams            = retObj.retParams,
                            thisPointerUsed      = retObj.thisPointerUsed,
                Severity: Major
                Found in src/extensions/default/JavaScriptRefactoring/ExtractToFunction.js - About 3 hrs to fix

                  File FindInFilesUI.js has 321 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  /*
                   * Copyright (c) 2014 - present Adobe Systems Incorporated. All rights reserved.
                   *
                   * Permission is hereby granted, free of charge, to any person obtaining a
                   * copy of this software and associated documentation files (the "Software"),
                  Severity: Minor
                  Found in src/search/FindInFilesUI.js - About 3 hrs to fix

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

                                var testAllHints = function () {
                                        testEditor.setCursorPos({ line: 2, ch: 12 });    // after ::
                                        var hintList = expectHints(CSSPseudoSelectorCodeHints.pseudoSelectorHints);
                                        console.log(JSON.stringify(hintList));
                                        verifyFirstEntry(hintList, "after");  // filtered on "empty string"
                    Severity: Major
                    Found in src/extensions/default/CSSPseudoSelectorHints/unittests.js and 1 other location - About 3 hrs to fix
                    src/extensions/default/CSSPseudoSelectorHints/unittests.js on lines 143..149

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

                    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 commit changes on the input event while the value is invalid, but should keep them in the text field", function () {
                                        makeUI("#abcdef");
                                        colorEditor.$colorValue.val("rgb(0, 0, 0");
                                        colorEditor.$colorValue.trigger("input");
                                        expect(tinycolor(colorEditor.getColor()).toHexString()).toBe("#abcdef");
                    Severity: Major
                    Found in src/extensions/default/InlineColorEditor/unittests.js and 1 other location - About 3 hrs to fix
                    src/extensions/default/InlineColorEditor/unittests.js on lines 1354..1360

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

                    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 revert to the previous value on the change event while the value is invalid", function () {
                                        makeUI("#abcdef");
                                        colorEditor.$colorValue.val("rgb(0, 0, 0");
                                        colorEditor.$colorValue.trigger("change");
                                        expect(tinycolor(colorEditor.getColor()).toHexString()).toBe("#abcdef");
                    Severity: Major
                    Found in src/extensions/default/InlineColorEditor/unittests.js and 1 other location - About 3 hrs to fix
                    src/extensions/default/InlineColorEditor/unittests.js on lines 1347..1353

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

                    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