adobe/brackets

View on GitHub

Showing 1,485 of 3,294 total issues

Function _mergePanes has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    function _mergePanes() {
        if (_panes.hasOwnProperty(SECOND_PANE)) {

            var firstPane = _panes[FIRST_PANE],
                secondPane = _panes[SECOND_PANE],
Severity: Minor
Found in src/view/MainViewManager.js - About 1 hr to fix

    Function _keydownHook has 28 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            function _keydownHook(event) {
                var keyCode;
    
                // (page) up, (page) down, enter and tab key are handled by the list
                if (event.type === "keydown") {
    Severity: Minor
    Found in src/utils/DropdownEventHandler.js - About 1 hr to fix

      Function setSelected has 28 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          ProjectModel.prototype.setSelected = function (path, doNotOpen) {
              path = _getPathFromFSObject(path);
      
              // Directories are not selectable
              if (!_pathIsFile(path)) {
      Severity: Minor
      Found in src/project/ProjectModel.js - About 1 hr to fix

        Function _initialLayout has 28 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            function _initialLayout(forceRefresh) {
                var panes = Object.keys(_panes),
                    size = 100 / panes.length;
        
                _.forEach(_panes, function (pane) {
        Severity: Minor
        Found in src/view/MainViewManager.js - About 1 hr to fix

          Function DOMUpdater has 28 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              function DOMUpdater(previousDOM, editor, changeList) {
                  var text, startOffset = 0, startOffsetPos;
          
                  this.isIncremental = false;
          
          
          Severity: Minor
          Found in src/language/HTMLInstrumentation.js - About 1 hr to fix

            Function positionHint has 28 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                function positionHint(xpos, ypos, ybot) {
                    var hintWidth = $hintContainer.width(),
                        hintHeight = $hintContainer.height(),
                        top = ypos - hintHeight - POINTER_TOP_OFFSET,
                        left = xpos,
            Severity: Minor
            Found in src/features/ParameterHintsManager.js - About 1 hr to fix

              Function finish has 28 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  finish: function( type ) {
                      if ( type !== false ) {
                          type = type || "fx";
                      }
                      return this.each(function() {
              Severity: Minor
              Found in src/thirdparty/jquery-2.1.3.js - About 1 hr to fix

                Function __iteratorUncached has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    skipSequence.__iteratorUncached = function(type, reverse) {var this$0 = this;
                      if (reverse) {
                        return this.cacheResult().__iterator(type, reverse);
                      }
                      var iterator = iterable.__iterator(ITERATE_ENTRIES, reverse);
                Severity: Minor
                Found in src/thirdparty/immutable.js - About 1 hr to fix

                  Function interposeFactory has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    function interposeFactory(iterable, separator) {
                      var interposedSequence = makeSequence(iterable);
                      interposedSequence.size = iterable.size && iterable.size * 2 -1;
                      interposedSequence.__iterateUncached = function(fn, reverse) {var this$0 = this;
                        var iterations = 0;
                  Severity: Minor
                  Found in src/thirdparty/immutable.js - About 1 hr to fix

                    Function ModalBar has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        function ModalBar(template, autoClose, animate) {
                            if (animate === undefined) {
                                animate = true;
                            }
                    
                    
                    Severity: Minor
                    Found in src/widgets/ModalBar.js - About 1 hr to fix

                      Function _handleKeyDown has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          QuickSearchField.prototype._handleKeyDown = function (event) {
                              if (event.keyCode === KeyEvent.DOM_VK_RETURN) {
                                  // Enter should always act on the latest results. If input has changed and we're still waiting for
                                  // new results, just flag the 'commit' for later
                                  if (this._displayedQuery === this.$input.val()) {
                      Severity: Minor
                      Found in src/search/QuickSearchField.js - About 1 hr to fix

                        Function _handleItemSelect has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            QuickNavigateDialog.prototype._handleItemSelect = function (selectedItem, query) {
                        
                                var doClose = true,
                                    self = this;
                        
                        
                        Severity: Minor
                        Found in src/search/QuickOpen.js - About 1 hr to fix

                          Function showSearchHints has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              FindBar.prototype.showSearchHints = function () {
                                  var self = this;
                                  var searchFieldInput = self.$("#find-what");
                                  this.searchField = new QuickSearchField(searchFieldInput, {
                                      verticalAdjust: searchFieldInput.offset().top > 0 ? 0 : this._modalBar.getRoot().outerHeight(),
                          Severity: Minor
                          Found in src/search/FindBar.js - About 1 hr to fix

                            Function searchAndShowResults has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                function searchAndShowResults(queryInfo, scope, filter, replaceText, candidateFilesPromise) {
                                    return FindInFiles.doSearchInScope(queryInfo, scope, filter, replaceText, candidateFilesPromise)
                                        .done(function (zeroFilesToken) {
                                            // Done searching all files: show results
                                            if (FindInFiles.searchModel.hasResults()) {
                            Severity: Minor
                            Found in src/search/FindInFilesUI.js - About 1 hr to fix

                              Function ScriptAgent has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                              Open

                              define(function ScriptAgent(require, exports, module) {
                                  "use strict";
                              
                                  var Inspector = require("LiveDevelopment/Inspector/Inspector");
                                  var DOMAgent = require("LiveDevelopment/Agents/DOMAgent");
                              Severity: Minor
                              Found in src/LiveDevelopment/Agents/ScriptAgent.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

                              Method typedef has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  def typedef(domain, info)
                                      return "[" + typedef(domain, info['items']) + "]" if info['items']
                                      if info["$ref"]
                                          ref = info["$ref"]
                                          ref = domain + "." + ref unless ref =~ /\./
                              Severity: Minor
                              Found in src/LiveDevelopment/Inspector/jsdoc.rb - 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 getJumptoDef has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              function getJumptoDef(fileInfo, offset) {
                                  var request = buildRequest(fileInfo, "definition", offset);
                                  // request.query.typeOnly = true;       // FIXME: tern doesn't work exactly right yet.
                              
                                  try {
                              Severity: Minor
                              Found in src/JSUtils/node/TernNodeDomain.js - About 1 hr to fix

                                Function _translateKeyboardEvent has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    function _translateKeyboardEvent(event) {
                                        var hasMacCtrl = (brackets.platform === "mac") ? (event.ctrlKey) : false,
                                            hasCtrl = (brackets.platform !== "mac") ? (event.ctrlKey) : (event.metaKey),
                                            hasAlt = (event.altKey),
                                            hasShift = (event.shiftKey),
                                Severity: Minor
                                Found in src/command/KeyBindingManager.js - About 1 hr to fix

                                  Function _updateCursorInfo has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      function _updateCursorInfo(event, editor) {
                                          editor = editor || EditorManager.getActiveEditor();
                                  
                                          // compute columns, account for tab size
                                          var cursor = editor.getCursorPos(true);
                                  Severity: Minor
                                  Found in src/editor/EditorStatusBar.js - About 1 hr to fix

                                    Function _setImplementation has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        function _setImplementation(multibrowser) {
                                            if (multibrowser) {
                                                // set implemenation
                                                LiveDevImpl = MultiBrowserLiveDev;
                                                // update styles for UI status
                                    Severity: Minor
                                    Found in src/LiveDevelopment/main.js - About 1 hr to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language