adobe/brackets

View on GitHub

Showing 1,485 of 3,294 total issues

Function handleSwitchLanguage has 44 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    function handleSwitchLanguage() {
        var stringsPath = FileUtils.getNativeBracketsDirectoryPath() + "/nls";

        FileSystem.getDirectoryForPath(stringsPath).getContents(function (err, entries) {
            if (!err) {
Severity: Minor
Found in src/extensions/default/DebugCommands/main.js - About 1 hr to fix

    Function loadExtensionModule has 44 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        function loadExtensionModule(name, config, entryPoint) {
            var extensionConfig = {
                context: name,
                baseUrl: config.baseUrl,
                paths: globalPaths,
    Severity: Minor
    Found in src/utils/ExtensionLoader.js - About 1 hr to fix

      Function drop has 44 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

                  function drop() {
                      preDropCleanup();
                      if (sourceView.paneId === currentView.paneId && startingIndex === $el.index()) {
                          // if the item was dragged but not moved then don't open or close
                          if (!dragged) {
      Severity: Minor
      Found in src/project/WorkingSetView.js - About 1 hr to fix

        Function findExternalChanges has 44 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            function findExternalChanges(docs) {
        
                toReload = [];
                toClose = [];
                editConflicts = [];
        Severity: Minor
        Found in src/project/FileSyncManager.js - About 1 hr to fix

          Function _getTagAttributeValue has 44 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              function _getTagAttributeValue(editor, pos) {
                  var ctx, tagName, attrName, exclusionList = [], offset, textBefore, textAfter;
          
                  ctx = TokenUtils.getInitialContext(editor._codeMirror, pos);
                  offset = TokenUtils.offsetInToken(ctx);
          Severity: Minor
          Found in src/language/XMLUtils.js - About 1 hr to fix

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

                HashCollisionNode.prototype.update = function(ownerID, shift, keyHash, key, value, didChangeSize, didAlter) {
                  if (keyHash === undefined) {
                    keyHash = hash(key);
                  }
            
            
            Severity: Minor
            Found in src/thirdparty/immutable.js - About 1 hr to fix

              Function getParameterHints has 44 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  ParameterHintsProvider.prototype.getParameterHints = function () {
                      if (!this.client) {
                          return null;
                      }
              
              
              Severity: Minor
              Found in src/languageTools/DefaultProviders.js - About 1 hr to fix

                Function _createServer has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                Open

                function _createServer(path, port, createCompleteCallback) {
                    var server,
                        app,
                        address,
                        pathKey = getPathKey(path);
                Severity: Minor
                Found in src/extensions/default/StaticServer/node/StaticServerDomain.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 CSSPreprocessorDocumentModule has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                Open

                define(function CSSPreprocessorDocumentModule(require, exports, module) {
                    "use strict";
                
                    var _               = require("thirdparty/lodash"),
                        EventDispatcher = require("utils/EventDispatcher"),
                Severity: Minor
                Found in src/LiveDevelopment/Documents/CSSPreprocessorDocument.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 _handleSoftTabNavigation has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    Editor.prototype._handleSoftTabNavigation = function (direction, functionName) {
                        var instance = this._codeMirror,
                            overallJump = null;
                
                        if (!instance.getOption("indentWithTabs") && PreferencesManager.get(SOFT_TABS)) {
                Severity: Minor
                Found in src/editor/Editor.js - About 1 hr to fix

                  Function init has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function init(domainManager) {
                      if (!domainManager.hasDomain("TernNodeDomain")) {
                          domainManager.registerDomain("TernNodeDomain", {major: 0, minor: 1});
                      }
                  
                  
                  Severity: Minor
                  Found in src/JSUtils/node/TernNodeDomain.js - About 1 hr to fix

                    Function ConsoleAgent has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    define(function ConsoleAgent(require, exports, module) {
                        "use strict";
                    
                        var Inspector = require("LiveDevelopment/Inspector/Inspector");
                    
                    
                    Severity: Minor
                    Found in src/LiveDevelopment/Agents/ConsoleAgent.js - About 1 hr to fix

                      Function NetworkAgent has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      define(function NetworkAgent(require, exports, module) {
                          "use strict";
                      
                          var Inspector = require("LiveDevelopment/Inspector/Inspector");
                      
                      
                      Severity: Minor
                      Found in src/LiveDevelopment/Agents/NetworkAgent.js - About 1 hr to fix

                        Function it has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                                function it(type, value) {
                                    var i, t;
                                    if (type === '(color)' || type === '(range)') {
                                        t = {type: type};
                                    } else if (type === '(punctuator)' ||

                          Function _wrapSelectedStatements has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              function _wrapSelectedStatements (wrapperName, err) {
                                  var editor = EditorManager.getActiveEditor();
                                  if (!editor) {
                                      return;
                                  }
                          Severity: Minor
                          Found in src/extensions/default/JavaScriptRefactoring/WrapSelection.js - About 1 hr to fix

                            Function _getPrefType has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                function _getPrefType(prefItem) {
                            
                                    var finalPrefType = "undefined";
                            
                                    if (prefItem) {
                            Severity: Minor
                            Found in src/extensions/default/DebugCommands/main.js - About 1 hr to fix

                              Function watchPath has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              function watchPath(path, ignored, _watcherMap) {
                                  try {
                                      var watcher = chokidar.watch(path, {
                                          persistent: true,
                                          ignoreInitial: true,
                              Severity: Minor
                              Found in src/filesystem/impls/appshell/node/ChokidarWatcher.js - About 1 hr to fix

                                Function setDirectoryOpen has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    ProjectModel.prototype.setDirectoryOpen = function (path, open) {
                                        var projectRelative = this.makeProjectRelativeIfPossible(path),
                                            needsLoading    = !this._viewModel.isPathLoaded(projectRelative),
                                            d               = new $.Deferred(),
                                            self            = this;
                                Severity: Minor
                                Found in src/project/ProjectModel.js - About 1 hr to fix

                                  Function flattenFactory has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                    function flattenFactory(iterable, depth, useKeys) {
                                      var flatSequence = makeSequence(iterable);
                                      flatSequence.__iterateUncached = function(fn, reverse) {
                                        var iterations = 0;
                                        var stopped = false;
                                  Severity: Minor
                                  Found in src/thirdparty/immutable.js - About 1 hr to fix

                                    Function _handleOtherRuntime has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        function _handleOtherRuntime(serverOptions) {
                                            function _getArguments(sOptions) {
                                                var args = [];
                                    
                                                if (sOptions.options && sOptions.options.execArgv) {
                                    Severity: Minor
                                    Found in src/languageTools/LanguageClient/ServerUtils.js - About 1 hr to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language