adobe/brackets

View on GitHub

Showing 1,485 of 3,294 total issues

Function _watchOrUnwatchEntry has 49 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    FileSystem.prototype._watchOrUnwatchEntry = function (entry, watchedRoot, callback, shouldWatch) {
        var impl = this._impl,
            recursiveWatch = impl.recursiveWatch,
            commandName = shouldWatch ? "watchPath" : "unwatchPath",
            filterGlobs = watchedRoot.filterGlobs;
Severity: Minor
Found in src/filesystem/FileSystem.js - About 1 hr to fix

    Function handleFSEvent has 49 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        ProjectModel.prototype.handleFSEvent = function (entry, added, removed) {
            this._resetCache();
    
            if (!entry) {
                this.refresh();
    Severity: Minor
    Found in src/project/ProjectModel.js - About 1 hr to fix

      Function _getSearchMatches has 49 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          function _getSearchMatches(contents, queryExpr) {
              // Quick exit if not found or if we hit the limit
              if (searchModel.foundMaximum || contents.search(queryExpr) === -1) {
                  return [];
              }
      Severity: Minor
      Found in src/search/FindInFiles.js - About 1 hr to fix

        Function setInlineContent has 48 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            InlineTextEditor.prototype.setInlineContent = function (doc, startLine, endLine) {
                var self = this;
        
                // Destroy the previous editor if we had one and clear out the filename info.
                if (this.editor) {
        Severity: Minor
        Found in src/editor/InlineTextEditor.js - About 1 hr to fix

          Function openLine has 48 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              function openLine(editor, direction) {
                  editor = editor || EditorManager.getFocusedEditor();
                  if (!editor) {
                      return;
                  }
          Severity: Minor
          Found in src/editor/EditorCommandHandlers.js - About 1 hr to fix

            Function extractAndValidateFiles has 48 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function extractAndValidateFiles(zipPath, extractDir, options, callback) {
                var unzipper = new DecompressZip(zipPath);
                unzipper.on("error", function (err) {
                    // General error to report for problems reading the file
                    callback(null, {
            Severity: Minor
            Found in src/extensibility/node/package-validator.js - About 1 hr to fix

              Function performCleanup has 48 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  function performCleanup(requester, filesToCache, notifyBack) {
                      var currentRequester = requester || "";
                      function filterFilesAndNotify(files, filesToCacheArr, notifyBackToBrackets) {
                          files.forEach(function (file) {
                              var fileExt = path.extname(path.basename(file));
              Severity: Minor
              Found in src/extensions/default/AutoUpdate/node/AutoUpdateDomain.js - About 1 hr to fix

                Function _determineDate has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    _determineDate: function(inst, date, defaultDate) {
                        var offsetNumeric = function(offset) {
                            var date = new Date();
                            date.setDate(date.getDate() + offset);
                            return date;

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

                      function init(domainManager) {
                          if (!domainManager.hasDomain("AutoUpdate")) {
                              domainManager.registerDomain("AutoUpdate", {
                                  major: 0,
                                  minor: 1
                  Severity: Minor
                  Found in src/extensions/default/AutoUpdate/node/AutoUpdateDomain.js - About 1 hr to fix

                    Function _createFileEntries has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        function _createFileEntries($mrofList) {
                            var data, fileEntry, $link, $newItem;
                            // Iterate over the MROF list and create the pop over UI items
                    
                            // If we are in split view we might want to show the panes corresponding to the entries
                    Severity: Minor
                    Found in src/extensions/default/NavigationAndHistory/main.js - About 1 hr to fix

                      Function _toggle has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          _toggle: function( event, eventData ) {
                              var that = this,
                                  toShow = eventData.newPanel,
                                  toHide = eventData.oldPanel;
                      
                      

                        Function statement has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            function statement(noindent) {
                                var i = indent, r, s = scope, t = nexttoken;
                        
                                if (t.id === ";") {
                                    advance(";");

                          Function CHILD has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                                  CHILD: function( elem, match ) {
                                      var first, last,
                                          doneName, parent, cache,
                                          count, diff,
                                          type = match[1],

                            Function data has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                data: function( key, value ) {
                                    var parts, part, attr, name, l,
                                        elem = this[0],
                                        i = 0,
                                        data = null;

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

                                      render: function () {
                                          var fullname = this.props.name,
                                              extension = LanguageManager.getCompoundFileExtension(fullname),
                                              name = _getName(fullname, extension);
                              
                              
                              Severity: Minor
                              Found in src/project/FileTreeView.js - About 1 hr to fix

                                Function buildFragment has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    buildFragment: function( elems, context, scripts, selection ) {
                                        var elem, tmp, tag, wrap, contains, j,
                                            fragment = context.createDocumentFragment(),
                                            nodes = [],
                                            i = 0,
                                Severity: Minor
                                Found in src/thirdparty/jquery-2.1.3.js - About 1 hr to fix

                                  Function hashJSObj has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                    function hashJSObj(obj) {
                                      var hash;
                                      if (usingWeakMap) {
                                        hash = weakMap.get(obj);
                                        if (hash !== undefined) {
                                  Severity: Minor
                                  Found in src/thirdparty/immutable.js - About 1 hr to fix

                                    Function RemoteAgent has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                                    Open

                                    define(function RemoteAgent(require, exports, module) {
                                        "use strict";
                                    
                                        var LiveDevelopment     = require("LiveDevelopment/LiveDevelopment"),
                                            EventDispatcher     = require("utils/EventDispatcher"),
                                    Severity: Minor
                                    Found in src/LiveDevelopment/Agents/RemoteAgent.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 JSDocumentModule has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                                    Open

                                    define(function JSDocumentModule(require, exports, module) {
                                        "use strict";
                                    
                                        var EventDispatcher = require("utils/EventDispatcher"),
                                            Inspector       = require("LiveDevelopment/Inspector/Inspector"),
                                    Severity: Minor
                                    Found in src/LiveDevelopment/Documents/JSDocument.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 getFragmentAround has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        function getFragmentAround(session, start) {
                                            var minIndent = null,
                                                minLine   = null,
                                                endLine,
                                                cm        = session.editor._codeMirror,
                                    Severity: Minor
                                    Found in src/JSUtils/ScopeManager.js - About 1 hr to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language