adobe/brackets

View on GitHub

Showing 3,294 of 3,294 total issues

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

    function _markTags(cm, node) {
        node.children.forEach(function (childNode) {
            if (childNode.isElement()) {
                _markTags(cm, childNode);
            }
Severity: Major
Found in src/language/HTMLInstrumentation.js and 1 other location - About 3 hrs to fix
src/LiveDevelopment/MultiBrowserImpl/language/HTMLInstrumentation.js on lines 192..200

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

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

            if ( val == null ) {
                val = "";

            } else if ( typeof val === "number" ) {
                val += "";
Severity: Major
Found in src/thirdparty/jquery-2.1.3.js and 1 other location - About 3 hrs to fix
src/extensions/default/JavaScriptQuickEdit/unittest-files/jquery-ui/jquery-1.7.2.js on lines 2411..2419

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

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

            if ( val == null ) {
                val = "";
            } else if ( typeof val === "number" ) {
                val += "";
            } else if ( jQuery.isArray( val ) ) {
src/thirdparty/jquery-2.1.3.js on lines 7357..7367

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

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 ( one === 1 ) {
            origFn = fn;
            fn = function( event ) {
                // Can use an empty set, since event contains the info
                jQuery().off( event );
Severity: Major
Found in src/thirdparty/jquery-2.1.3.js and 1 other location - About 3 hrs to fix
src/extensions/default/JavaScriptQuickEdit/unittest-files/jquery-ui/jquery-1.7.2.js on lines 3795..3804

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

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 prev = (this._canAdjustMonth(inst, -1, drawYear, drawMonth) ?
            '<a class="ui-datepicker-prev ui-corner-all" data-handler="prev" data-event="click"' +
            ' title="' + prevText + '"><span class="ui-icon ui-icon-circle-triangle-' + ( isRTL ? 'e' : 'w') + '">' + prevText + '</span></a>' :
            (hideIfNoPrevNext ? '' : '<a class="ui-datepicker-prev ui-corner-all ui-state-disabled" title="'+ prevText +'"><span class="ui-icon ui-icon-circle-triangle-' + ( isRTL ? 'e' : 'w') + '">' + prevText + '</span></a>'));
src/extensions/default/JavaScriptQuickEdit/unittest-files/jquery-ui/ui/jquery.ui.datepicker.js on lines 1498..1501

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

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 change nothing when cursor at end", function () {  // (bug #1314)
                testEditor.setCursorPos({ line: 5, ch: 8 });    // cursor between end of existing attribute name ("id") and =
                selectHint(HTMLCodeHints.attrHintProvider, "id");
                expect(testDocument.getLine(5)).toBe("  <h1 id='foo'>Heading</h1>");
                expectCursorAt({ line: 5, ch: 8 });            // cursor stays at end of attr name
Severity: Major
Found in src/extensions/default/HTMLCodeHints/unittests.js and 1 other location - About 3 hrs to fix
src/extensions/default/HTMLCodeHints/unittests.js on lines 531..536

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 96.

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 insert a new attribute before the existing one that starts at cursor", function () {  // (bug #1312)
                testEditor.setCursorPos({ line: 5, ch: 6 });    // cursor between space and start of existing attribute name ("id")
                selectHint(HTMLCodeHints.attrHintProvider, "class");
                expect(testDocument.getLine(5)).toBe("  <h1 class=\"\"id='foo'>Heading</h1>");
                expectCursorAt({ line: 5, ch: 13 });            // cursor between two double-quotes
Severity: Major
Found in src/extensions/default/HTMLCodeHints/unittests.js and 1 other location - About 3 hrs to fix
src/extensions/default/HTMLCodeHints/unittests.js on lines 537..542

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

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 ( one === 1 ) {
            origFn = fn;
            fn = function( event ) {
                // Can use an empty set, since event contains the info
                jQuery().off( event );
src/thirdparty/jquery-2.1.3.js on lines 4845..4854

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

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 next = (this._canAdjustMonth(inst, +1, drawYear, drawMonth) ?
            '<a class="ui-datepicker-next ui-corner-all" data-handler="next" data-event="click"' +
            ' title="' + nextText + '"><span class="ui-icon ui-icon-circle-triangle-' + ( isRTL ? 'w' : 'e') + '">' + nextText + '</span></a>' :
            (hideIfNoPrevNext ? '' : '<a class="ui-datepicker-next ui-corner-all ui-state-disabled" title="'+ nextText + '"><span class="ui-icon ui-icon-circle-triangle-' + ( isRTL ? 'w' : 'e') + '">' + nextText + '</span></a>'));
src/extensions/default/JavaScriptQuickEdit/unittest-files/jquery-ui/ui/jquery.ui.datepicker.js on lines 1490..1493

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

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

    _create: function() {
        var accordionId = this.accordionId = "ui-accordion-" +
                (this.element.attr( "id" ) || ++uid),
            options = this.options;

    Function parseFloat has 76 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    Globalize.parseFloat = function( value, radix, cultureSelector ) {
        // radix argument is optional
        if ( typeof radix !== "number" ) {
            cultureSelector = radix;
            radix = 10;

      File ExtensionManagerViewModel.js has 292 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/ExtensionManagerViewModel.js - About 3 hrs to fix

        Function apply has 75 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            DOMEditHandler.prototype.apply = function (edits) {
                var targetID,
                    targetElement,
                    childElement,
                    self = this;
        Severity: Major
        Found in src/LiveDevelopment/Agents/RemoteFunctions.js - About 3 hrs to fix

          Function doJumpToDef has 75 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  JSJumpToDefProvider.prototype.doJumpToDef = function () {
                      var offset,
                          handleJumpResponse;
          
          
          
          Severity: Major
          Found in src/extensions/default/JavaScriptCodeHints/main.js - About 3 hrs to fix

            Function Datepicker has 75 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function Datepicker() {
                this.debug = false; // Change this to true to start debugging
                this._curInst = null; // The current instance in use
                this._keyEvent = false; // If the last event was a key event
                this._disabledInputs = []; // List of date picker inputs that have been disabled

              Consider simplifying this complex logical expression.
              Open

              if ( "getBoundingClientRect" in document.documentElement ) {
                  getOffset = function( elem, doc, docElem, box ) {
                      try {
                          box = elem.getBoundingClientRect();
                      } catch(e) {}

                Function _parseSelector has 75 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        function _parseSelector(start, level) {
                
                            currentSelector = "";
                            selectorStartChar = start;
                            selectorStartLine = line;
                Severity: Major
                Found in src/language/CSSUtils.js - About 3 hrs to fix

                  Function Sizzle has 75 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function Sizzle( selector, context, results, seed ) {
                      var match, elem, m, nodeType,
                          // QSA vars
                          i, groups, old, nid, newContext, newSelector;
                  
                  
                  Severity: Major
                  Found in src/thirdparty/jquery-2.1.3.js - About 3 hrs to fix

                    Function getContextInfo has 75 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        function getContextInfo(editor, constPos, requireParent, requireNextToken) {
                            var pos, ctx, ctxPrev, ctxNext, offset, keyName, valueName, parentKeyName,
                                isArray, exclusionList, hasColon, hasComma, hasBracket, shouldReplace;
                    
                            pos = $.extend({}, constPos);
                    Severity: Major
                    Found in src/language/JSONUtils.js - About 3 hrs to fix

                      Function _keydownHook has 75 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          InlineMenu.prototype._keydownHook = function (event) {
                              var keyCode,
                                  self = this;
                      
                              // positive distance rotates down; negative distance rotates up
                      Severity: Major
                      Found in src/widgets/InlineMenu.js - About 3 hrs to fix
                        Severity
                        Category
                        Status
                        Source
                        Language