adobe/brackets

View on GitHub

Showing 3,294 of 3,294 total issues

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

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

                function _getBrowserDiff(editor, browserSimpleDOM) {
                    var cachedValue = _cachedValues[editor.document.file.fullPath],
                        editorRoot  = cachedValue.dom,
                        browserRoot;
            
            
            src/language/HTMLInstrumentation.js on lines 675..687

            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 91.

            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

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

                function _getBrowserDiff(editor, browserSimpleDOM) {
                    var cachedValue = _cachedValues[editor.document.file.fullPath],
                        editorRoot  = cachedValue.dom,
                        browserRoot;
            
            
            Severity: Major
            Found in src/language/HTMLInstrumentation.js and 1 other location - About 2 hrs to fix
            src/LiveDevelopment/MultiBrowserImpl/language/HTMLInstrumentation.js on lines 649..661

            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 91.

            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(notificationHandlers && Array.isArray(notificationHandlers) && notificationHandlers.length) {
                        notificationHandlers.forEach(function (handler) {
                            if(validateHandler(handler)) {
                                handler.call(null, messageParams.params);
                            }
            Severity: Major
            Found in src/languageTools/LanguageClient/LanguageClient.js and 1 other location - About 2 hrs to fix
            src/languageTools/LanguageClientWrapper.js on lines 274..282

            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 91.

            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 ( state === 2 ) {
                                    if ( !responseHeaders ) {
                                        responseHeaders = {};
                                        while( ( match = rheaders.exec( responseHeadersString ) ) ) {
                                            responseHeaders[ match[1].toLowerCase() ] = match[ 2 ];
            src/thirdparty/jquery-2.1.3.js on lines 7952..7960

            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 91.

            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 ( state === 2 ) {
                                    if ( !responseHeaders ) {
                                        responseHeaders = {};
                                        while ( (match = rheaders.exec( responseHeadersString )) ) {
                                            responseHeaders[ match[1].toLowerCase() ] = match[ 2 ];
            Severity: Major
            Found in src/thirdparty/jquery-2.1.3.js and 1 other location - About 2 hrs to fix
            src/extensions/default/JavaScriptQuickEdit/unittest-files/jquery-ui/jquery-1.7.2.js on lines 7420..7428

            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 91.

            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 (notificationHandlers && Array.isArray(notificationHandlers) && notificationHandlers.length) {
                        notificationHandlers.forEach(function (handler) {
                            if (validateHandler(handler)) {
                                handler.call(null, params.params);
                            }
            Severity: Major
            Found in src/languageTools/LanguageClientWrapper.js and 1 other location - About 2 hrs to fix
            src/languageTools/LanguageClient/LanguageClient.js on lines 174..182

            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 91.

            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

            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

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

                              if (ctx.token.type === "tag") {
                                  tagName = ctx.token.string;
                                  if (TokenUtils.movePrevToken(ctx)) {
                                      if (ctx.token.type === "tag bracket" && ctx.token.string === "<") {
                                          break;
                  Severity: Major
                  Found in src/language/XMLUtils.js and 1 other location - About 2 hrs to fix
                  src/language/XMLUtils.js on lines 114..122

                  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 90.

                  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

                      _activate: function(event) {
                          var draggable = $.ui.ddmanager.current;
                          if(this.options.activeClass) this.element.addClass(this.options.activeClass);
                          (draggable && this._trigger('activate', event, this.ui(draggable)));
                      },
                  src/extensions/default/JavaScriptQuickEdit/unittest-files/jquery-ui/ui/jquery.ui.droppable.js on lines 75..79

                  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 90.

                  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 (ctxPrev.token.type === "tag") {
                                  tagName = ctxPrev.token.string;
                                  if (TokenUtils.movePrevToken(ctxPrev)) {
                                      if (ctxPrev.token.type === "tag bracket" && ctxPrev.token.string === "<") {
                                          break;
                  Severity: Major
                  Found in src/language/XMLUtils.js and 1 other location - About 2 hrs to fix
                  src/language/XMLUtils.js on lines 204..212

                  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 90.

                  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

                      _deactivate: function(event) {
                          var draggable = $.ui.ddmanager.current;
                          if(this.options.activeClass) this.element.removeClass(this.options.activeClass);
                          (draggable && this._trigger('deactivate', event, this.ui(draggable)));
                      },
                  src/extensions/default/JavaScriptQuickEdit/unittest-files/jquery-ui/ui/jquery.ui.droppable.js on lines 69..73

                  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 90.

                  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