adobe/brackets

View on GitHub

Showing 3,294 of 3,294 total issues

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

    function loadAgents() {
        // If we're already loading agents return same promise
        if (_loadAgentsPromise) {
            return _loadAgentsPromise;
        }
Severity: Minor
Found in src/LiveDevelopment/LiveDevelopment.js - About 1 hr to fix

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

            function formatHints(hints, query) {
                return hints.map(function (token) {
                    var $hintObj    = $("<span>").addClass("brackets-js-hints");
    
                    // level indicates either variable scope or property confidence
    Severity: Minor
    Found in src/extensions/default/JavaScriptCodeHints/main.js - About 1 hr to fix

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

          UrlCodeHints.prototype.insertHtmlHint = function (completion) {
              var cursor = this.editor.getCursorPos(),
                  start = {line: -1, ch: -1},
                  end = {line: -1, ch: -1},
                  tagInfo = HTMLUtils.getTagInfo(this.editor, cursor),
      Severity: Minor
      Found in src/extensions/default/UrlCodeHints/main.js - About 1 hr to fix

        Function _generatePosition has 44 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);
                var pageX = event.pageX;
                var pageY = event.pageY;

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

              effect: function( effect, options, speed, callback ) {
                  var args = _normalizeArguments.apply( this, arguments ),
                      mode = args.mode,
                      queue = args.queue,
                      effectMethod = $.effects.effect[ args.effect ],

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

                load: function( url, params, callback ) {
                    if ( typeof url !== "string" && _load ) {
                        return _load.apply( this, arguments );
            
                    // Don't do a request if no elements are being requested

              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 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 _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

                            Similar blocks of code found in 2 locations. Consider refactoring.
                            Open

                                function _swapWorkingSetListIndexes(paneId, index1, index2) {
                                    var pane = _getPane(paneId);
                            
                                    pane.swapViewListIndexes(index1, index2);
                                    exports.trigger("workingSetSort", pane.id);
                            Severity: Major
                            Found in src/view/MainViewManager.js and 1 other location - About 1 hr to fix
                            src/view/MainViewManager.js on lines 904..910

                            Duplicated Code

                            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                            Tuning

                            This issue has a mass of 70.

                            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                            Refactorings

                            Further Reading

                            Similar blocks of code found in 2 locations. Consider refactoring.
                            Open

                                        } else if (event.shiftKey &&
                                                (event.keyCode === KeyEvent.DOM_VK_UP ||
                                                 event.keyCode === KeyEvent.DOM_VK_DOWN ||
                                                 event.keyCode === KeyEvent.DOM_VK_PAGE_UP ||
                                                 event.keyCode === KeyEvent.DOM_VK_PAGE_DOWN)) {
                            Severity: Major
                            Found in src/editor/CodeHintList.js and 1 other location - About 1 hr to fix
                            src/widgets/InlineMenu.js on lines 344..366

                            Duplicated Code

                            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                            Tuning

                            This issue has a mass of 70.

                            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                            Refactorings

                            Further Reading

                            Similar blocks of code found in 2 locations. Consider refactoring.
                            Open

                                            case 33: $.datepicker._adjustDate(event.target, (event.ctrlKey ?
                                                        -$.datepicker._get(inst, 'stepBigMonths') :
                                                        -$.datepicker._get(inst, 'stepMonths')), 'M');
                                                    break; // previous month/year on page up/+ ctrl
                            src/extensions/default/JavaScriptQuickEdit/unittest-files/jquery-ui/ui/jquery.ui.datepicker.js on lines 554..557

                            Duplicated Code

                            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                            Tuning

                            This issue has a mass of 70.

                            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                            Refactorings

                            Further Reading

                            Similar blocks of code found in 2 locations. Consider refactoring.
                            Open

                                        if (endInclusive) {
                                            return (start.line < pos.line || start.ch <= pos.ch) &&  // inclusive
                                                (end.line > pos.line   || end.ch >= pos.ch);      // inclusive
                                        } else {
                            Severity: Major
                            Found in src/editor/Editor.js and 1 other location - About 1 hr to fix
                            src/editor/Editor.js on lines 1300..1303

                            Duplicated Code

                            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                            Tuning

                            This issue has a mass of 70.

                            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                            Refactorings

                            Further Reading

                            Similar blocks of code found in 2 locations. Consider refactoring.
                            Open

                                        } else {
                                            return (start.line < pos.line || start.ch <= pos.ch) &&  // inclusive
                                                (end.line > pos.line   || end.ch > pos.ch);       // exclusive
                                        }
                            Severity: Major
                            Found in src/editor/Editor.js and 1 other location - About 1 hr to fix
                            src/editor/Editor.js on lines 1297..1300

                            Duplicated Code

                            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                            Tuning

                            This issue has a mass of 70.

                            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                            Refactorings

                            Further Reading

                            Severity
                            Category
                            Status
                            Source
                            Language