adobe/brackets

View on GitHub

Showing 1,485 of 3,294 total issues

Function _setDirectoryOpen has 32 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    function _setDirectoryOpen(treeData, path, open) {
        var objectPath = _filePathToObjectPath(treeData, path),
            directory = treeData.getIn(objectPath);

        if (!objectPath) {
Severity: Minor
Found in src/project/FileTreeViewModel.js - About 1 hr to fix

    Function registerHandlersAndDomains has 32 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            function registerHandlersAndDomains(ws, port) {
                // Called if we succeed at the final setup
                function success() {
                    self._ws.onclose = function () {
                        if (self._autoReconnect) {
    Severity: Minor
    Found in src/utils/NodeConnection.js - About 1 hr to fix

      Function _sendData has 32 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              function _sendData(fileSize) {
                  var subType = "";
      
                  if(fileSize/1024 <= 1) {
      
      
      Severity: Minor
      Found in src/utils/HealthLogger.js - About 1 hr to fix

        Function on has 32 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            var on = function (events, fn) {
                var eventsList = events.split(/\s+/).map(splitNs),
                    i;
        
                if (!fn) {
        Severity: Minor
        Found in src/utils/EventDispatcher.js - About 1 hr to fix

          Function style has 32 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              style: function( elem, name, value, extra ) {
          
                  // Don't set styles on text and comment nodes
                  if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {
                      return;
          Severity: Minor
          Found in src/thirdparty/jquery-2.1.3.js - About 1 hr to fix

            Function getTagInfo has 32 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                function getTagInfo(editor, pos) {
                    var ctx, offset, tagAttrs, tagAttrValue;
            
                    ctx = TokenUtils.getInitialContext(editor._codeMirror, pos);
                    offset = TokenUtils.offsetInToken(ctx);
            Severity: Minor
            Found in src/language/XMLUtils.js - About 1 hr to fix

              Function findBlocks has 32 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  function findBlocks(editor, modeName) {
                      // Start scanning from beginning of file
                      var ctx = TokenUtils.getInitialContext(editor._codeMirror, {line: 0, ch: 0}),
                          blocks = [],
                          currentBlock = null,
              Severity: Minor
              Found in src/language/HTMLUtils.js - About 1 hr to fix

                Function removeClass has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    removeClass: function( value ) {
                        var classes, elem, cur, clazz, j, finalValue,
                            proceed = arguments.length === 0 || typeof value === "string" && value,
                            i = 0,
                            len = this.length;
                Severity: Minor
                Found in src/thirdparty/jquery-2.1.3.js - About 1 hr to fix

                  Function load has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  jQuery.fn.load = function( url, params, callback ) {
                      if ( typeof url !== "string" && _load ) {
                          return _load.apply( this, arguments );
                      }
                  
                  
                  Severity: Minor
                  Found in src/thirdparty/jquery-2.1.3.js - About 1 hr to fix

                    Function popUpHint has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        function popUpHint(editor, explicit, onCursorActivity) {
                            var request = null;
                            var $deferredPopUp = $.Deferred();
                            var sessionProvider = null;
                    
                    
                    Severity: Minor
                    Found in src/features/ParameterHintsManager.js - About 1 hr to fix

                      Function addClass has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          addClass: function( value ) {
                              var classes, elem, cur, clazz, j, finalValue,
                                  proceed = typeof value === "string" && value,
                                  i = 0,
                                  len = this.length;
                      Severity: Minor
                      Found in src/thirdparty/jquery-2.1.3.js - About 1 hr to fix

                        Function createFilterPicker has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            function createFilterPicker(context) {
                        
                                function itemRenderer(item, index) {
                                    if (index < FIRST_FILTER_INDEX) {
                                        // Prefix the two filter commands with 'recent-filter-name' so that
                        Severity: Minor
                        Found in src/search/FileFilters.js - About 1 hr to fix

                          Function _doOpenWithOptionalPath has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              function _doOpenWithOptionalPath(fullPath, silent, paneId, options) {
                                  var result;
                                  paneId = paneId || MainViewManager.ACTIVE_PANE;
                                  if (!fullPath) {
                                      // Create placeholder deferred
                          Severity: Minor
                          Found in src/document/DocumentCommandHandlers.js - About 1 hr to fix

                            Function parsePersonString has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                            Open

                            function parsePersonString(obj) {
                                if (typeof (obj) === "string") {
                                    var parts = _personRegex.exec(obj);
                            
                                    // No regex match, so we just synthesize an object with an opaque name string
                            Severity: Minor
                            Found in src/extensibility/node/package-validator.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 QuickOpenPlugin has 10 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                                function QuickOpenPlugin(name, languageIds, done, search, match, itemFocus, itemSelect, resultsFormatter, matcherOptions, label) {
                            Severity: Major
                            Found in src/search/QuickOpen.js - About 1 hr to fix

                              Function removeMenu has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  function removeMenu(id) {
                                      var menu,
                                          commandID = "";
                              
                                      if (!id) {
                              Severity: Minor
                              Found in src/command/Menus.js - About 1 hr to fix

                                Function _onActiveEditorChange has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    function _onActiveEditorChange(event, current, previous) {
                                        if (previous) {
                                            previous.off(".statusbar");
                                            previous.document.off(".statusbar");
                                            previous.document.releaseRef();
                                Severity: Minor
                                Found in src/editor/EditorStatusBar.js - About 1 hr to fix

                                  Function filterWithQueryAndMatcher has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                          function filterWithQueryAndMatcher(hints, matcher) {
                                              var matchResults = $.map(hints, function (hint) {
                                                  var searchResult = matcher.match(hint.value, query);
                                                  if (searchResult) {
                                                      searchResult.value = hint.value;
                                  Severity: Minor
                                  Found in src/JSUtils/Session.js - About 1 hr to fix

                                    Function onClose has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                            onClose: function () {
                                                var body = window.document.getElementsByTagName("body")[0],
                                                    overlay = window.document.createElement("div"),
                                                    background = window.document.createElement("div"),
                                                    status = window.document.createElement("div");

                                      Function positionPreview has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                          function positionPreview(editor, xpos, ypos, ybot) {
                                              var previewWidth  = $previewContainer.outerWidth(),
                                                  top           = ypos - $previewContainer.outerHeight() - POINTER_HEIGHT,
                                                  left          = xpos - previewWidth / 2,
                                                  elementRect = {
                                      Severity: Minor
                                      Found in src/extensions/default/QuickView/main.js - About 1 hr to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language