adobe/brackets

View on GitHub

Showing 3,294 of 3,294 total issues

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

        else if (/^(sw)$/.test(a)) {
            that.size.width = os.width + ox;
            that.size.height = os.height + oy;
            that.position.left = op.left - ox;
        }
src/extensions/default/JavaScriptQuickEdit/unittest-files/jquery-ui/ui/jquery.ui.resizable.js on lines 776..791

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

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 _setStatus(status, closeReason) {
        // Don't send a notification when the status didn't actually change
        if (status === exports.status) {
            return;
        }
Severity: Major
Found in src/LiveDevelopment/LiveDevMultiBrowser.js and 1 other location - About 1 hr to fix
src/LiveDevelopment/LiveDevelopment.js on lines 333..343

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

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

        else if (/^(ne)$/.test(a)) {
            that.size.width = os.width + ox;
            that.size.height = os.height + oy;
            that.position.top = op.top - oy;
        }
src/extensions/default/JavaScriptQuickEdit/unittest-files/jquery-ui/ui/jquery.ui.resizable.js on lines 781..791

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

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

    wrap: function( html ) {
        var isFunction = jQuery.isFunction( html );

        return this.each(function(i) {
            jQuery( this ).wrapAll( isFunction ? html.call(this, i) : html );
src/thirdparty/jquery-2.1.3.js on lines 8382..8388

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

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

                    for ( l = attr.length; i < l; i++ ) {
                        name = attr[i].name;

                        if ( name.indexOf( "data-" ) === 0 ) {
                            name = jQuery.camelCase( name.substring(5) );
src/thirdparty/jquery-2.1.3.js on lines 3791..3797

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

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 ( attrs[ i ] ) {
                            name = attrs[ i ].name;
                            if ( name.indexOf( "data-" ) === 0 ) {
                                name = jQuery.camelCase( name.slice(5) );
                                dataAttr( elem, name, data[ name ] );
Severity: Major
Found in src/thirdparty/jquery-2.1.3.js and 1 other location - About 1 hr to fix
src/extensions/default/JavaScriptQuickEdit/unittest-files/jquery-ui/jquery-1.7.2.js on lines 1924..1932

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

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 _setStatus(status, closeReason) {
        // Don't send a notification when the status didn't actually change
        if (status === exports.status) {
            return;
        }
Severity: Major
Found in src/LiveDevelopment/LiveDevelopment.js and 1 other location - About 1 hr to fix
src/LiveDevelopment/LiveDevMultiBrowser.js on lines 201..211

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

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

    wrap: function( html ) {
        var isFunction = jQuery.isFunction( html );

        return this.each(function( i ) {
            jQuery( this ).wrapAll( isFunction ? html.call(this, i) : html );
Severity: Major
Found in src/thirdparty/jquery-2.1.3.js and 1 other location - About 1 hr to fix
src/extensions/default/JavaScriptQuickEdit/unittest-files/jquery-ui/jquery-1.7.2.js on lines 5828..5834

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

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

    DOMNode.prototype.previousSibling = function previousSibling() {
        if (!this.parent) {
            return null;
        }
        return this.parent.children[this.parent.indexOfChild(this) - 1];
Severity: Major
Found in src/LiveDevelopment/Agents/DOMNode.js and 1 other location - About 1 hr to fix
src/LiveDevelopment/Agents/DOMNode.js on lines 321..326

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

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

    DOMNode.prototype.nextSibling = function nextSibling() {
        if (!this.parent) {
            return null;
        }
        return this.parent.children[this.parent.indexOfChild(this) + 1];
Severity: Major
Found in src/LiveDevelopment/Agents/DOMNode.js and 1 other location - About 1 hr to fix
src/LiveDevelopment/Agents/DOMNode.js on lines 313..318

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

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

    function _handleExtensionLoad(e, path) {
        function setData(metadata) {
            var locationType,
                id = metadata.name,
                userExtensionPath = ExtensionLoader.getUserExtensionPath();
Severity: Minor
Found in src/extensibility/ExtensionManager.js - About 1 hr to fix

    Function getFragmentAround has 47 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        function getFragmentAround(session, start) {
            var minIndent = null,
                minLine   = null,
                endLine,
                cm        = session.editor._codeMirror,
    Severity: Minor
    Found in src/JSUtils/ScopeManager.js - About 1 hr to fix

      Function open has 47 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          function open(restart) {
              // If close() is still pending, wait for close to finish before opening
              if (_isPromisePending(_closeDeferred)) {
                  return _closeDeferred.then(function () {
                      return open(restart);
      Severity: Minor
      Found in src/LiveDevelopment/LiveDevelopment.js - About 1 hr to fix

        Function _createMROFDisplayList has 47 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            function _createMROFDisplayList(refresh) {
                var $def = $.Deferred();
                
                var $mrofList, $link, $newItem;
        
        
        Severity: Minor
        Found in src/extensions/default/NavigationAndHistory/main.js - About 1 hr to fix

          Function moveView has 47 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              Pane.prototype.moveView = function (file, destinationPane, destinationIndex) {
                  var self = this,
                      openNextPromise = new $.Deferred(),
                      result = new $.Deferred();
          
          
          Severity: Minor
          Found in src/view/Pane.js - About 1 hr to fix

            Function select has 47 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            select = Sizzle.select = function( selector, context, results, seed ) {
                var i, tokens, token, type, find,
                    compiled = typeof selector === "function" && selector,
                    match = !seed && tokenize( (selector = compiled.selector || selector) );
            
            
            Severity: Minor
            Found in src/thirdparty/jquery-2.1.3.js - About 1 hr to fix

              Function validateNotificationParams has 47 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  function validateNotificationParams(type, params) {
                      var validatedParams = null;
              
                      params = params || {};
              
              
              Severity: Minor
              Found in src/languageTools/LanguageClientWrapper.js - About 1 hr to fix

                Function getHints has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    CodeHintsProvider.prototype.getHints = function (implicitChar) {
                        if (!this.client) {
                            return null;
                        }
                
                
                Severity: Minor
                Found in src/languageTools/DefaultProviders.js - About 1 hr to fix

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

                              it("should jump to function", function () {
                                  var start = { line: 43, ch: 0 };
                  
                                  testEditor.setCursorPos(start);
                                  runs(function () {
                  Severity: Major
                  Found in src/extensions/default/JavaScriptCodeHints/unittests.js and 11 other locations - About 1 hr to fix
                  src/extensions/default/JavaScriptCodeHints/unittests.js on lines 1067..1074
                  src/extensions/default/JavaScriptCodeHints/unittests.js on lines 1076..1083
                  src/extensions/default/JavaScriptCodeHints/unittests.js on lines 1103..1110
                  src/extensions/default/JavaScriptCodeHints/unittests.js on lines 1112..1119
                  src/extensions/default/JavaScriptCodeHints/unittests.js on lines 1121..1128
                  src/extensions/default/JavaScriptCodeHints/unittests.js on lines 1383..1390
                  src/extensions/default/JavaScriptCodeHints/unittests.js on lines 1392..1399
                  src/extensions/default/JavaScriptCodeHints/unittests.js on lines 1401..1408
                  src/extensions/default/JavaScriptCodeHints/unittests.js on lines 1410..1417
                  src/extensions/default/JavaScriptCodeHints/unittests.js on lines 1419..1426
                  src/extensions/default/JavaScriptCodeHints/unittests.js on lines 1747..1754

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

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

                              it("should jump to parameter passed in anonymous method", function () {
                                  var start = { line: 83, ch: 25 };
                  
                                  testEditor.setCursorPos(start);
                                  runs(function () {
                  Severity: Major
                  Found in src/extensions/default/JavaScriptCodeHints/unittests.js and 11 other locations - About 1 hr to fix
                  src/extensions/default/JavaScriptCodeHints/unittests.js on lines 1058..1065
                  src/extensions/default/JavaScriptCodeHints/unittests.js on lines 1067..1074
                  src/extensions/default/JavaScriptCodeHints/unittests.js on lines 1076..1083
                  src/extensions/default/JavaScriptCodeHints/unittests.js on lines 1103..1110
                  src/extensions/default/JavaScriptCodeHints/unittests.js on lines 1121..1128
                  src/extensions/default/JavaScriptCodeHints/unittests.js on lines 1383..1390
                  src/extensions/default/JavaScriptCodeHints/unittests.js on lines 1392..1399
                  src/extensions/default/JavaScriptCodeHints/unittests.js on lines 1401..1408
                  src/extensions/default/JavaScriptCodeHints/unittests.js on lines 1410..1417
                  src/extensions/default/JavaScriptCodeHints/unittests.js on lines 1419..1426
                  src/extensions/default/JavaScriptCodeHints/unittests.js on lines 1747..1754

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

                  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