adobe/brackets

View on GitHub

Showing 1,485 of 3,294 total issues

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

    itself.data = function () {

        var data = { functions: [], options: option }, fu, globals, implieds = [], f, i, j,
            members = [], n, unused = [], v;
        if (itself.errors.length) {

    Function findClosestCulture has 72 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    Globalize.findClosestCulture = function( name ) {
        var match;
        if ( !name ) {
            return this.cultures[ this.cultureSelector ] || this.cultures[ "default" ];
        }

      Function inspectFile has 72 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          function inspectFile(file, providerList) {
              var response = new $.Deferred(),
                  results = [];
      
              providerList = providerList || getProvidersForPath(file.fullPath);
      Severity: Major
      Found in src/language/CodeInspection.js - About 2 hrs to fix

        File FileUtils.js has 286 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        /*
         * Copyright (c) 2012 - present Adobe Systems Incorporated. All rights reserved.
         *
         * Permission is hereby granted, free of charge, to any person obtaining a
         * copy of this software and associated documentation files (the "Software"),
        Severity: Minor
        Found in src/file/FileUtils.js - About 2 hrs to fix

          File main.js has 285 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          /*
           * Copyright (c) 2012 - present Adobe Systems Incorporated. All rights reserved.
           *
           * Permission is hereby granted, free of charge, to any person obtaining a
           * copy of this software and associated documentation files (the "Software"),
          Severity: Minor
          Found in src/extensions/default/RecentProjects/main.js - About 2 hrs to fix

            Function add has 71 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                add: function( elem, types, handler, data, selector ) {
            
                    var elemData, eventHandle, events,
                        t, tns, type, namespaces, handleObj,
                        handleObjIn, quick, handlers, special;

              Function sidebarList has 71 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  function sidebarList($scrollerElement, selectedClassName, leafClassName) {
                      var $listElement = $scrollerElement.find("ul"),
                          $selectionMarker,
                          $selectionExtension,
                          $sidebar = $("#sidebar"),
              Severity: Major
              Found in src/utils/ViewUtils.js - About 2 hrs to fix

                Function _beforeHTMLReady has 71 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    function _beforeHTMLReady() {
                        // Add the platform (mac, win or linux) to the body tag so we can have platform-specific CSS rules
                        $("body").addClass("platform-" + brackets.platform);
                
                        // Browser-hosted version may also have different CSS (e.g. since '#titlebar' is shown)
                Severity: Major
                Found in src/brackets.js - About 2 hrs to fix

                  Function editFilter has 71 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      function editFilter(filter, index) {
                          var lastFocus = window.document.activeElement;
                  
                          var templateVars = {
                                  instruction: StringUtils.format(Strings.FILE_FILTER_INSTRUCTIONS, brackets.config.glob_help_url),
                  Severity: Major
                  Found in src/search/FileFilters.js - About 2 hrs to fix

                    File InstallExtensionDialog.js has 284 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    /*
                     * Copyright (c) 2012 - present Adobe Systems Incorporated. All rights reserved.
                     *
                     * Permission is hereby granted, free of charge, to any person obtaining a
                     * copy of this software and associated documentation files (the "Software"),
                    Severity: Minor
                    Found in src/extensibility/InstallExtensionDialog.js - About 2 hrs to fix

                      File ViewCommandHandlers.js has 284 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      /*
                       * Copyright (c) 2012 - present Adobe Systems Incorporated. All rights reserved.
                       *
                       * Permission is hereby granted, free of charge, to any person obtaining a
                       * copy of this software and associated documentation files (the "Software"),
                      Severity: Minor
                      Found in src/view/ViewCommandHandlers.js - About 2 hrs to fix

                        Function formatDate has 70 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            formatDate: function (format, date, settings) {
                                if (!date)
                                    return '';
                                var dayNamesShort = (settings ? settings.dayNamesShort : null) || this._defaults.dayNamesShort;
                                var dayNames = (settings ? settings.dayNames : null) || this._defaults.dayNames;

                          Function widget has 70 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          $.widget = function( name, base, prototype ) {
                              var fullName, existingConstructor, constructor, basePrototype,
                                  namespace = name.split( "." )[ 0 ];
                          
                              name = name.split( "." )[ 1 ];

                            Function _findAllFunctionsInText has 70 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                function _findAllFunctionsInText(text) {
                                    var AST,
                                        results = {},
                                        functionName,
                                        resultNode,
                            Severity: Major
                            Found in src/language/JSUtils.js - About 2 hrs to fix

                              File main.js has 283 lines of code (exceeds 250 allowed). Consider refactoring.
                              Open

                              /*
                              * Copyright (c) 2013 Patrick Oladimeji. All rights reserved.
                              *
                              * Permission is hereby granted, free of charge, to any person obtaining a
                              * copy of this software and associated documentation files (the "Software"),
                              Severity: Minor
                              Found in src/extensions/default/CodeFolding/main.js - About 2 hrs to fix

                                Function EditAgent has 69 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                define(function EditAgent(require, exports, module) {
                                    "use strict";
                                
                                    var Inspector = require("LiveDevelopment/Inspector/Inspector");
                                    var DOMAgent = require("LiveDevelopment/Agents/DOMAgent");
                                Severity: Major
                                Found in src/LiveDevelopment/Agents/EditAgent.js - About 2 hrs to fix

                                  Function createGettersAndSetters has 69 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      function createGettersAndSetters() {
                                          var editor = EditorManager.getActiveEditor();
                                          if (!editor) {
                                              return;
                                          }
                                  Severity: Major
                                  Found in src/extensions/default/JavaScriptRefactoring/WrapSelection.js - About 2 hrs to fix

                                    Function EditAgent has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
                                    Open

                                    define(function EditAgent(require, exports, module) {
                                        "use strict";
                                    
                                        var Inspector = require("LiveDevelopment/Inspector/Inspector");
                                        var DOMAgent = require("LiveDevelopment/Agents/DOMAgent");
                                    Severity: Minor
                                    Found in src/LiveDevelopment/Agents/EditAgent.js - About 2 hrs 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 cookie has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
                                    Open

                                    jQuery.cookie = function (key, value, options) {
                                    
                                        // key and value given, set cookie...
                                        if (arguments.length > 1 && (value === null || typeof value !== "object")) {
                                            options = jQuery.extend({}, options);

                                    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 inlineProvider has 68 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        function inlineProvider(hostEditor, pos) {
                                            var jsonFile, propInfo,
                                                propQueue = [], // priority queue of propNames to try
                                                langId = hostEditor.getLanguageForSelection().getId(),
                                                supportedLangs = {
                                    Severity: Major
                                    Found in src/extensions/default/MDNDocs/main.js - About 2 hrs to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language