adobe/brackets

View on GitHub

Showing 3,294 of 3,294 total issues

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

                if(rs) ui.position.left = inst._convertPositionTo("relative", { top: 0, left: r - inst.helperProportions.width }).left - inst.margins.left;
src/extensions/default/JavaScriptQuickEdit/unittest-files/jquery-ui/ui/jquery.ui.draggable.js on lines 762..762

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

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(ts) ui.position.top = inst._convertPositionTo("relative", { top: t - inst.helperProportions.height, left: 0 }).top - inst.margins.top;
src/extensions/default/JavaScriptQuickEdit/unittest-files/jquery-ui/ui/jquery.ui.draggable.js on lines 774..774

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

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

                Object.keys(removed).forEach(function (v, i) {
                    _transport.send(JSON.stringify({
                        method: "StylesheetRemoved",
                        href: v,
                        roots: [removed[v]]
src/LiveDevelopment/MultiBrowserImpl/protocol/remote/DocumentObserver.js on lines 183..189

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

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

            isOverElementWidth = (this.options.axis === 'y') || $.ui.isOverAxis(this.positionAbs.left + this.offset.click.left, item.left, item.width),
src/extensions/default/JavaScriptQuickEdit/unittest-files/jquery-ui/ui/jquery.ui.sortable.js on lines 468..468

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

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 verifyTagHints(hintList, expectedFirstHint) {
            expect(hintList.indexOf("id")).toBe(-1);   // make sure attribute names aren't sneaking in there

            expectedFirstHint = expectedFirstHint || "a";  // assume unfiltered lists always start with "a"
            expect(hintList[0]).toBe(expectedFirstHint);
Severity: Major
Found in src/extensions/default/HTMLCodeHints/unittests.js and 1 other location - About 1 hr to fix
src/extensions/default/HTMLCodeHints/unittests.js on lines 90..95

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

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 woset = Math.abs( (that._helper ? that.offset.left - cop.left : (that.offset.left - cop.left)) + that.sizeDiff.width ),
src/extensions/default/JavaScriptQuickEdit/unittest-files/jquery-ui/ui/jquery.ui.resizable.js on lines 704..704

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

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 verifyAttrHints(hintList, expectedFirstHint) {
            expect(hintList.indexOf("div")).toBe(-1);   // make sure tag names aren't sneaking in there

            expectedFirstHint = expectedFirstHint || "accesskey";  // assume unfiltered lists always start with "accesskey"
            expect(hintList[0]).toBe(expectedFirstHint);
Severity: Major
Found in src/extensions/default/HTMLCodeHints/unittests.js and 1 other location - About 1 hr to fix
src/extensions/default/HTMLCodeHints/unittests.js on lines 82..87

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

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 isOverElementHeight = (this.options.axis === 'x') || $.ui.isOverAxis(this.positionAbs.top + this.offset.click.top, item.top, item.height),
src/extensions/default/JavaScriptQuickEdit/unittest-files/jquery-ui/ui/jquery.ui.sortable.js on lines 469..469

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

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 syncDocToFoldsCache has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

function syncDocToFoldsCache(cm, from, lineAdded) {
    "use strict";
    var minFoldSize = prefs.getSetting("minFoldSize") || 2;
    var opts = cm.state.foldGutter.options || {};
    var rf = opts.rangeFinder || CodeMirror.fold.auto;
Severity: Minor
Found in src/extensions/default/CodeFolding/unittest-files/test.js - About 1 hr to fix

Cognitive Complexity

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

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

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

Further reading

Function installFromURL has 39 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    function installFromURL(url) {
        var STATE_DOWNLOADING = 1,
            STATE_INSTALLING = 2,
            STATE_SUCCEEDED = 3,
            STATE_FAILED = 4;
Severity: Minor
Found in src/extensibility/Package.js - About 1 hr to fix

    Function _getSelectorName has 39 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        function _getSelectorName(editor, pos) {
            var tagInfo = HTMLUtils.getTagInfo(editor, pos),
                selectorName = "",
                reason;
    
    
    Severity: Minor
    Found in src/editor/CSSInlineEditor.js - About 1 hr to fix

      Function related has 39 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          function related() {
      
              var rel = {
                  scripts: {},
                  stylesheets: {}

        Function setJumpSelection has 39 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                    function setJumpSelection(start, end, isFunction) {
        
                        /**
                         * helper function to decide if the tokens on the RHS of an assignment
                         * look like an identifier, or member expr.
        Severity: Minor
        Found in src/extensions/default/JavaScriptCodeHints/main.js - About 1 hr to fix

          Function _getValidBezierParams has 39 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              function _getValidBezierParams(match) {
                  var param,
                      // take ease-in-out as default value in case there are no params yet (or they are invalid)
                      def = [ ".42", "0", ".58", "1" ],
                      oldIndex = match.index, // we need to store the old match.index to re-set the index afterwards

            Function assume has 39 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                function assume() {
                    if (option.couch) {
                        combine(predefined, couch);
                    }
            
            

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

                  open: function() {
                      if ( this._isOpen ) {
                          return;
                      }
              
              

                Function bridge has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                $.widget.bridge = function( name, object ) {
                    var fullName = object.prototype.widgetFullName;
                    $.fn[ name ] = function( options ) {
                        var isMethodCall = typeof options === "string",
                            args = slice.call( arguments, 1 ),

                  Function when has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      when: function( firstParam ) {
                          var args = sliceDeferred.call( arguments, 0 ),
                              i = 0,
                              length = args.length,
                              pValues = new Array( length ),

                    Function ColorEditor has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        function ColorEditor($parent, color, callback, swatches) {
                            // Create the DOM structure, filling in localized strings via Mustache
                            this.$element = $(Mustache.render(ColorEditorTemplate, Strings));
                            $parent.append(this.$element);
                    
                    
                    Severity: Minor
                    Found in src/extensions/default/InlineColorEditor/ColorEditor.js - About 1 hr to fix

                      Function addCombinator has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      function addCombinator( matcher, combinator, base ) {
                          var dir = combinator.dir,
                              checkNonElements = base && dir === "parentNode",
                              doneName = done++;
                      
                      
                      Severity: Minor
                      Found in src/thirdparty/jquery-2.1.3.js - About 1 hr to fix
                        Severity
                        Category
                        Status
                        Source
                        Language