adobe/brackets

View on GitHub

Showing 3,294 of 3,294 total issues

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

    if ( dataTypes[ 0 ] in responses ) {
        finalDataType = dataTypes[ 0 ];
    } else {
        // Try convertible dataTypes
        for ( type in responses ) {
Severity: Major
Found in src/thirdparty/jquery-2.1.3.js and 1 other location - About 4 hrs to fix
src/extensions/default/JavaScriptQuickEdit/unittest-files/jquery-ui/jquery-1.7.2.js on lines 7855..7870

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

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

  $.fn.popover = function (option) {
    return this.each(function () {
      var $this = $(this)
        , data = $this.data('popover')
        , options = typeof option == 'object' && option
Severity: Major
Found in src/widgets/bootstrap-popover.js and 2 other locations - About 4 hrs to fix
src/widgets/bootstrap-scrollspy.js on lines 125..133
src/widgets/bootstrap-tooltip.js on lines 326..334

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

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

  $.fn.scrollspy = function (option) {
    return this.each(function () {
      var $this = $(this)
        , data = $this.data('scrollspy')
        , options = typeof option == 'object' && option
Severity: Major
Found in src/widgets/bootstrap-scrollspy.js and 2 other locations - About 4 hrs to fix
src/widgets/bootstrap-popover.js on lines 86..94
src/widgets/bootstrap-tooltip.js on lines 326..334

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

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 ( dataTypes[ 0 ] in responses ) {
        finalDataType = dataTypes[ 0 ];
    } else {
        // Try convertible dataTypes
        for ( type in responses ) {
src/thirdparty/jquery-2.1.3.js on lines 7685..7700

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

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

define(function CSSAgent(require, exports, module) {
    "use strict";

    var _ = require("thirdparty/lodash");

Severity: Major
Found in src/LiveDevelopment/Agents/CSSAgent.js - About 4 hrs to fix

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

                it("should retrieve the HTML docs database", function () {
                    var json;
                    
                    runs(function () {
                        main._getDocs("html.json").done(function (result) {
    Severity: Major
    Found in src/extensions/default/MDNDocs/unittests.js and 1 other location - About 4 hrs to fix
    src/extensions/default/MDNDocs/unittests.js on lines 89..103

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

    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 close parameter hint when move off function", function () {
                    var testPos = { line: 184, ch: 12 },
                        endPos  = { line: 184, ch: 19 };
                    testEditor.setCursorPos(testPos);
                    runs(function () {
    Severity: Major
    Found in src/extensions/default/JavaScriptCodeHints/unittests.js and 1 other location - About 4 hrs to fix
    src/extensions/default/JavaScriptCodeHints/unittests.js on lines 1262..1274

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

    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 close parameter hint when move off function to another function", function () {
                    var testPos = { line: 184, ch: 12 },
                        newPos  = { line: 181, ch: 12 };
                    testEditor.setCursorPos(testPos);
                    runs(function () {
    Severity: Major
    Found in src/extensions/default/JavaScriptCodeHints/unittests.js and 1 other location - About 4 hrs to fix
    src/extensions/default/JavaScriptCodeHints/unittests.js on lines 1248..1260

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

    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 retrieve the CSS docs database", function () {
                    var json;
    
                    runs(function () {
                        main._getDocs("css.json").done(function (result) {
    Severity: Major
    Found in src/extensions/default/MDNDocs/unittests.js and 1 other location - About 4 hrs to fix
    src/extensions/default/MDNDocs/unittests.js on lines 105..119

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

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

    var Sizzle = function( selector, context, results, seed ) {
        results = results || [];
        context = context || document;
    
        var origContext = context;

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

                  it("should NOT insert =\"\" after valueless attribute", function () {
                      testDocument.replaceRange("  <input \n", { line: 9, ch: 0 });  // insert new line
      
                      testEditor.setCursorPos({ line: 9, ch: 9 });    // cursor after trailing space
                      selectHint(HTMLCodeHints.attrHintProvider, "checked");
      Severity: Major
      Found in src/extensions/default/HTMLCodeHints/unittests.js and 2 other locations - About 4 hrs to fix
      src/extensions/default/HTMLCodeHints/unittests.js on lines 544..551
      src/extensions/default/HTMLCodeHints/unittests.js on lines 553..560

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

      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 a valueless attribute before the existing attribute that starts at cursor", function () {
                      testDocument.replaceRange("  <input id='foo'>\n", { line: 9, ch: 0 });  // insert new line
      
                      testEditor.setCursorPos({ line: 9, ch: 9 });    // cursor after between "i" and "d"
                      selectHint(HTMLCodeHints.attrHintProvider, "checked");
      Severity: Major
      Found in src/extensions/default/HTMLCodeHints/unittests.js and 2 other locations - About 4 hrs to fix
      src/extensions/default/HTMLCodeHints/unittests.js on lines 522..529
      src/extensions/default/HTMLCodeHints/unittests.js on lines 553..560

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

      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 a new atribute with an empty value before the existing valueless attribute", function () {
                      testDocument.replaceRange("  <input checked>\n", { line: 9, ch: 0 });  // insert new line
      
                      testEditor.setCursorPos({ line: 9, ch: 9 });    // cursor after trailing space
                      selectHint(HTMLCodeHints.attrHintProvider, "class");
      Severity: Major
      Found in src/extensions/default/HTMLCodeHints/unittests.js and 2 other locations - About 4 hrs to fix
      src/extensions/default/HTMLCodeHints/unittests.js on lines 522..529
      src/extensions/default/HTMLCodeHints/unittests.js on lines 544..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 121.

      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 ( that.orientation === "horizontal" ) {
                              if ( i === 0 ) {
                                  that.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( { left: valPercent + "%" }, o.animate );
                              }
                              if ( i === 1 ) {
      src/extensions/default/JavaScriptQuickEdit/unittest-files/jquery-ui/ui/jquery.ui.slider.js on lines 598..605

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

      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

      jQuery.each( [ "get", "post" ], function( i, method ) {
          jQuery[ method ] = function( url, data, callback, type ) {
              // shift arguments if data argument was omitted
              if ( jQuery.isFunction( data ) ) {
                  type = type || callback;
      src/thirdparty/jquery-2.1.3.js on lines 8297..8314

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

      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

      jQuery.each( [ "get", "post" ], function( i, method ) {
          jQuery[ method ] = function( url, data, callback, type ) {
              // Shift arguments if data argument was omitted
              if ( jQuery.isFunction( data ) ) {
                  type = type || callback;
      Severity: Major
      Found in src/thirdparty/jquery-2.1.3.js and 1 other location - About 4 hrs to fix
      src/extensions/default/JavaScriptQuickEdit/unittest-files/jquery-ui/jquery-1.7.2.js on lines 7236..7253

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

      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 ( i === 0 ) {
                                  that.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( { bottom: ( valPercent ) + "%" }, o.animate );
                              }
                              if ( i === 1 ) {
      src/extensions/default/JavaScriptQuickEdit/unittest-files/jquery-ui/ui/jquery.ui.slider.js on lines 591..598

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

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

          function _init() {
      
              $cursorInfo         = $("#status-cursor");
              $fileInfo           = $("#status-file");
              $indentType         = $("#indent-type");
      Severity: Major
      Found in src/editor/EditorStatusBar.js - About 4 hrs to fix

        Function string has 107 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                        function string(x) {
                            var c, j, r = '', allowNewLine = false;
        
                            if (jsonmode && x !== '"') {
                                warningAt("Strings must use doublequote.",

          Function _doSaveAs has 107 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              function _doSaveAs(doc, settings) {
                  var origPath,
                      saveAsDefaultPath,
                      defaultName,
                      result = new $.Deferred();
          Severity: Major
          Found in src/document/DocumentCommandHandlers.js - About 4 hrs to fix
            Severity
            Category
            Status
            Source
            Language