adobe/brackets

View on GitHub

Showing 3,294 of 3,294 total issues

File unittests.js has 423 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/extensions/default/QuickView/unittests.js - About 6 hrs to fix

    File unittests.js has 423 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /*
     * Copyright (c) 2012 - 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/extensions/default/JavaScriptQuickEdit/unittests.js - About 6 hrs to fix

      File BezierCurveEditor.js has 419 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"),

        File ExtensionManagerDomain.js has 418 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/node/ExtensionManagerDomain.js - About 6 hrs to fix

          Function build has 150 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              Builder.prototype.build = function (strict, markCache) {
                  var self = this;
                  var token, lastClosedTag, lastTextNode;
                  var stack = this.stack;
                  var attributeName = null;
          Severity: Major
          Found in src/LiveDevelopment/MultiBrowserImpl/language/HTMLSimpleDOM.js - About 6 hrs to fix

            Function Callbacks has 150 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            jQuery.Callbacks = function( flags ) {
            
                // Convert flags from String-formatted to Object-formatted
                // (we check in cache first)
                flags = flags ? ( flagsCache[ flags ] || createFlags( flags ) ) : {};

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

                          top: (
                              pageY                                                                // The absolute mouse position
                              - this.offset.click.top                                                    // Click offset (relative to the element)
                              - this.offset.relative.top                                                // Only for relative positioned nodes: Relative offset from element to offset parent
                              - this.offset.parent.top                                                // The offsetParent's offset without borders (offset + border)
              src/extensions/default/JavaScriptQuickEdit/unittest-files/jquery-ui/ui/jquery.ui.draggable.js on lines 465..471

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

              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

                          left: (
                              pageX                                                                // The absolute mouse position
                              - this.offset.click.left                                                // Click offset (relative to the element)
                              - this.offset.relative.left                                                // Only for relative positioned nodes: Relative offset from element to offset parent
                              - this.offset.parent.left                                                // The offsetParent's offset without borders (offset + border)
              src/extensions/default/JavaScriptQuickEdit/unittest-files/jquery-ui/ui/jquery.ui.draggable.js on lines 458..464

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

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              File unittests.js has 416 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              /*
               * Copyright (c) 2015 - 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/extensions/default/PrefsCodeHints/unittests.js - About 6 hrs to fix

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

                            it("should handle reading an invalid configuration file", function () {
                                getPreferences(testPath + "negative-test/.jscodehints");
                                waitsFor(function () {
                                    return preferences !== null;
                                });
                Severity: Major
                Found in src/extensions/default/JavaScriptCodeHints/unittests.js and 1 other location - About 5 hrs to fix
                src/extensions/default/JavaScriptCodeHints/unittests.js on lines 1591..1604

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

                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

                                case 39: if (event.ctrlKey || event.metaKey) $.datepicker._adjustDate(event.target, (isRTL ? -1 : +1), 'D');
                                        handled = event.ctrlKey || event.metaKey;
                                        // +1 day on ctrl or command +right
                                        if (event.originalEvent.altKey) $.datepicker._adjustDate(event.target, (event.ctrlKey ?
                                                    +$.datepicker._get(inst, 'stepBigMonths') :
                src/extensions/default/JavaScriptQuickEdit/unittest-files/jquery-ui/ui/jquery.ui.datepicker.js on lines 564..571

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

                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

                                case 37: if (event.ctrlKey || event.metaKey) $.datepicker._adjustDate(event.target, (isRTL ? +1 : -1), 'D');
                                        handled = event.ctrlKey || event.metaKey;
                                        // -1 day on ctrl or command +left
                                        if (event.originalEvent.altKey) $.datepicker._adjustDate(event.target, (event.ctrlKey ?
                                                    -$.datepicker._get(inst, 'stepBigMonths') :
                src/extensions/default/JavaScriptQuickEdit/unittest-files/jquery-ui/ui/jquery.ui.datepicker.js on lines 575..582

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

                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 handle reading an empty configuration file", function () {
                                getPreferences(testPath + "defaults-test/.jscodehints");
                                waitsFor(function () {
                                    return preferences !== null;
                                });
                Severity: Major
                Found in src/extensions/default/JavaScriptCodeHints/unittests.js and 1 other location - About 5 hrs to fix
                src/extensions/default/JavaScriptCodeHints/unittests.js on lines 1608..1621

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

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

                    Builder.prototype.build = function (strict, markCache) {
                        var self = this;
                        var token, lastClosedTag, lastTextNode;
                        var stack = this.stack;
                        var attributeName = null;
                Severity: Major
                Found in src/language/HTMLSimpleDOM.js - About 5 hrs to fix

                  Function GotoAgent has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
                  Open

                  define(function GotoAgent(require, exports, module) {
                      "use strict";
                  
                      require("utils/Global");
                  
                  
                  Severity: Minor
                  Found in src/LiveDevelopment/Agents/GotoAgent.js - About 5 hrs 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

                  File strings.js has 413 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  /*
                   * Copyright (c) 2012 - 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/nls/nb/strings.js - About 5 hrs to fix

                    Function CSSDocumentModule has 146 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    define(function CSSDocumentModule(require, exports, module) {
                        "use strict";
                    
                        var _               = require("thirdparty/lodash"),
                            EventDispatcher = require("utils/EventDispatcher"),
                    Severity: Major
                    Found in src/LiveDevelopment/Documents/CSSDocument.js - About 5 hrs to fix

                      File DefaultProviders.js has 409 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      /*
                       * Copyright (c) 2019 - present Adobe. 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/languageTools/DefaultProviders.js - About 5 hrs to fix

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

                                if ( !arguments.length ) {
                                    if ( elem ) {
                                        hooks = jQuery.valHooks[ elem.type ] || jQuery.valHooks[ elem.nodeName.toLowerCase() ];
                        
                                        if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) {
                        Severity: Major
                        Found in src/thirdparty/jquery-2.1.3.js and 1 other location - About 5 hrs to fix
                        src/extensions/default/JavaScriptQuickEdit/unittest-files/jquery-ui/jquery-1.7.2.js on lines 2375..2393

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

                        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

                                    top: (
                                        pos.top                                                                    // The absolute mouse position
                                        + this.offset.relative.top * mod                                        // Only for relative positioned nodes: Relative offset from element to offset parent
                                        + this.offset.parent.top * mod                                            // The offsetParent's offset without borders (offset + border)
                                        - ($.browser.safari && $.browser.version < 526 && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ) * mod)
                        src/extensions/default/JavaScriptQuickEdit/unittest-files/jquery-ui/ui/jquery.ui.draggable.js on lines 405..410

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

                        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