adobe/brackets

View on GitHub

Showing 3,294 of 3,294 total issues

Function _getParameterHint has 36 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    JSParameterHintsProvider.prototype._getParameterHint = function (pushExistingHint, hint, functionInfo) {
        var result = $.Deferred();
        functionInfo = functionInfo || this.session.getFunctionInfo();
        if (!functionInfo.inFunctionCall) {
            this.cleanHintState();

    Function checkInstallerStatus has 36 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        function checkInstallerStatus(requester, searchParams) {
            var installErrorStr = searchParams.installErrorStr,
                bracketsErrorStr = searchParams.bracketsErrorStr,
                updateDirectory = searchParams.updateDir,
                encoding =        searchParams.encoding || "utf8",
    Severity: Minor
    Found in src/extensions/default/AutoUpdate/node/AutoUpdateDomain.js - About 1 hr to fix

      Function checkHealthDataSend has 36 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          function checkHealthDataSend(forceSend) {
              var result         = new $.Deferred(),
                  isHDTracking   = prefs.get("healthDataTracking"),
                  nextTimeToSend,
                  currentTime;
      Severity: Minor
      Found in src/extensions/default/HealthData/HealthDataManager.js - About 1 hr to fix

        Function name has 36 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            $.fn[ name ] = function( options ) {
                var isMethodCall = typeof options === "string",
                    args = slice.call( arguments, 1 ),
                    returnValue = this;
        
        

          Function _generatePosition has 36 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              _generatePosition: function(event) {
          
                  var o = this.options, scroll = this.cssPosition == 'absolute' && !(this.scrollParent[0] != document && $.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName);
          
                  // This is another very weird special case that only happens for relative elements:

            Function refresh has 36 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                refresh: function() {
                    // initialize nested menus
                    var menus,
                        submenus = this.element.find( this.options.menus + ":not(.ui-menu)" )
                            .addClass( "ui-menu ui-widget ui-widget-content ui-corner-all" )

              Function clip has 36 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              $.effects.effect.clip = function( o, done ) {
                  // Create element
                  var el = $( this ),
                      props = [ "position", "top", "bottom", "left", "right", "height", "width" ],
                      mode = $.effects.setMode( el, o.mode || "hide" ),

                Function _handleKeydown has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    ColorEditor.prototype._handleKeydown = function (event) {
                        var hasCtrl = (brackets.platform === "win") ? (event.ctrlKey) : (event.metaKey);
                        if (hasCtrl) {
                            switch (event.keyCode) {
                            case KeyEvent.DOM_VK_Z:
                Severity: Minor
                Found in src/extensions/default/InlineColorEditor/ColorEditor.js - About 1 hr to fix

                  Function _createIntermediateDirectories has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      function _createIntermediateDirectories(treeData, path) {
                          var objectPath = [],
                              result = {
                                  objectPath: objectPath,
                                  treeData: treeData
                  Severity: Minor
                  Found in src/project/FileTreeViewModel.js - About 1 hr to fix

                    Function showProjectPreferencesDialog has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        function showProjectPreferencesDialog(baseUrl, errorMessage) {
                            var $baseUrlControl,
                                dialog;
                    
                            // Title
                    Severity: Minor
                    Found in src/preferences/PreferencesDialogs.js - About 1 hr to fix

                      Function render has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                              render: function () {
                                  var extensions = this.props.extensions,
                                      iconClass = extensions && extensions.get("icons") ? "jstree-icons" : "jstree-no-icons",
                                      ulProps = this.props.isRoot ? {
                                          className: "jstree-brackets jstree-no-dots " + iconClass
                      Severity: Minor
                      Found in src/project/FileTreeView.js - About 1 hr to fix

                        Function off has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            var off = function (events, fn) {
                                if (!this._eventHandlers) {
                                    return this;
                                }
                        
                        
                        Severity: Minor
                        Found in src/utils/EventDispatcher.js - About 1 hr to fix

                          Function _getExclusionList has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              function _getExclusionList(editor, constPos) {
                                  var ctxPrev, ctxNext, exclusionList = [], pos, braceParity;
                          
                                  // Move back to find exclusions.
                                  pos = $.extend({}, constPos);
                          Severity: Minor
                          Found in src/language/JSONUtils.js - About 1 hr to fix

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

                                when: function( subordinate /* , ..., subordinateN */ ) {
                                    var i = 0,
                                        resolveValues = slice.call( arguments ),
                                        length = resolveValues.length,
                            
                            
                            Severity: Minor
                            Found in src/thirdparty/jquery-2.1.3.js - About 1 hr to fix

                              Function update has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  ArrayMapNode.prototype.update = function(ownerID, shift, keyHash, key, value, didChangeSize, didAlter) {
                                    var removed = value === NOT_SET;
                              
                                    var entries = this.entries;
                                    var idx = 0;
                              Severity: Minor
                              Found in src/thirdparty/immutable.js - About 1 hr to fix

                                Function zipWithFactory has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                  function zipWithFactory(keyIter, zipper, iters) {
                                    var zipSequence = makeSequence(keyIter);
                                    zipSequence.size = new ArraySeq(iters).map(function(i ) {return i.size}).min();
                                    // Note: this a generic base implementation of __iterate in terms of
                                    // __iterator which may be more generically useful in the future.
                                Severity: Minor
                                Found in src/thirdparty/immutable.js - About 1 hr to fix

                                  Function compile has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      function compile(userFilter) {
                                          // Automatically apply ** prefix/suffix to make writing simple substring-match filters more intuitive
                                          var wrappedGlobs = userFilter.map(function (glob) {
                                              // Automatic "**" prefix if not explicitly present
                                              if (glob.substr(0, 2) !== "**") {
                                  Severity: Minor
                                  Found in src/search/FileFilters.js - About 1 hr to fix

                                    Function offsetToLineNum has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                                    Open

                                    function offsetToLineNum(textOrLines, offset) {
                                        if (Array.isArray(textOrLines)) {
                                            var lines = textOrLines,
                                                total = 0,
                                                line;
                                    Severity: Minor
                                    Found in src/search/node/FindInFilesDomain.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 removeMenuDivider has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        Menu.prototype.removeMenuDivider = function (menuItemID) {
                                            var menuItem,
                                                $HTMLMenuItem;
                                    
                                            if (!menuItemID) {
                                    Severity: Minor
                                    Found in src/command/Menus.js - About 1 hr to fix

                                      Function _attachments has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                          _attachments: function(input, inst) {
                                              var appendText = this._get(inst, 'appendText');
                                              var isRTL = this._get(inst, 'isRTL');
                                              if (inst.append)
                                                  inst.append.remove();
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language