adobe/brackets

View on GitHub

Showing 3,294 of 3,294 total issues

File LanguageManager.js has 553 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: Major
Found in src/language/LanguageManager.js - About 1 day to fix

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

        function formatParameterHint(params, appendSeparators, appendParameter, typesOnly) {
            var result = "",
                pendingOptional = false;
    
            params.forEach(function (value, i) {
    Severity: Major
    Found in src/JSUtils/node/TernNodeDomain.js and 1 other location - About 1 day to fix
    src/extensions/default/JavaScriptCodeHints/HintUtils2.js on lines 49..103

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

    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 formatParameterHint(params, appendSeparators, appendParameter, typesOnly) {
            var result = "",
                pendingOptional = false;
    
            params.forEach(function (value, i) {
    Severity: Major
    Found in src/extensions/default/JavaScriptCodeHints/HintUtils2.js and 1 other location - About 1 day to fix
    src/JSUtils/node/TernNodeDomain.js on lines 607..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 220.

    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 (token.type) {
                    if (token.type.trim() !== '?') {
                        if (token.type.length < 30) {
                            $('<span>' + token.type.split('->').join(':').toString().trim() + '</span>').appendTo($hintObj).addClass("brackets-js-hints-type-details");
                        }
    Severity: Major
    Found in src/extensions/default/JavaScriptCodeHints/main.js and 1 other location - About 1 day to fix
    src/languageTools/DefaultProviders.js on lines 63..74

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

    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 (token.detail) {
                if (token.detail.trim() !== '?') {
                    if (token.detail.length < 30) {
                        $('<span>' + token.detail.split('->').join(':').toString().trim() + '</span>').appendTo($hintObj).addClass("brackets-hints-type-details");
                    }
    Severity: Major
    Found in src/languageTools/DefaultProviders.js and 1 other location - About 1 day to fix
    src/extensions/default/JavaScriptCodeHints/main.js on lines 179..190

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

    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 jquery.effects.core.js has 545 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /*!
     * jQuery UI Effects @VERSION
     *
     * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
     * Dual licensed under the MIT or GPL Version 2 licenses.

      File main.js has 541 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: Major
      Found in src/extensions/default/DebugCommands/main.js - About 1 day to fix

        Function _showDialog has 223 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            function _showDialog() {
                var dialog,
                    $dlg,
                    views   = [],
                    $search,
        Severity: Major
        Found in src/extensibility/ExtensionManagerDialog.js - About 1 day to fix

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

                      it("should insert hint as '.for' since keywords can be used as property names", function () {
                          var start = { line: 49, ch: 0 },
                              middle = { line: 49, ch: 5 },
                              end = { line: 49, ch: 7 };
          
          
          Severity: Major
          Found in src/extensions/default/JavaScriptCodeHints/unittests.js and 4 other locations - About 1 day to fix
          src/extensions/default/JavaScriptCodeHints/unittests.js on lines 722..737
          src/extensions/default/JavaScriptCodeHints/unittests.js on lines 757..771
          src/extensions/default/JavaScriptCodeHints/unittests.js on lines 1010..1024
          src/extensions/default/JavaScriptCodeHints/unittests.js on lines 1026..1040

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

          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 5 locations. Consider refactoring.
          Open

                      it("should insert property hints with no current query", function () {
                          var start   = { line: 6, ch: 0 },
                              middle  = { line: 6, ch: 3 },
                              end     = { line: 6, ch: 8 };
          
          
          Severity: Major
          Found in src/extensions/default/JavaScriptCodeHints/unittests.js and 4 other locations - About 1 day to fix
          src/extensions/default/JavaScriptCodeHints/unittests.js on lines 757..771
          src/extensions/default/JavaScriptCodeHints/unittests.js on lines 1010..1024
          src/extensions/default/JavaScriptCodeHints/unittests.js on lines 1026..1040
          src/extensions/default/JavaScriptCodeHints/unittests.js on lines 1042..1056

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

          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 5 locations. Consider refactoring.
          Open

                      it("should insert, not replace, property hints with a partial current query", function () {
                          var start   = { line: 6, ch: 0 },
                              middle  = { line: 6, ch: 6 },
                              end     = { line: 6, ch: 8 };
          
          
          Severity: Major
          Found in src/extensions/default/JavaScriptCodeHints/unittests.js and 4 other locations - About 1 day to fix
          src/extensions/default/JavaScriptCodeHints/unittests.js on lines 722..737
          src/extensions/default/JavaScriptCodeHints/unittests.js on lines 1010..1024
          src/extensions/default/JavaScriptCodeHints/unittests.js on lines 1026..1040
          src/extensions/default/JavaScriptCodeHints/unittests.js on lines 1042..1056

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

          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 5 locations. Consider refactoring.
          Open

                      it("should insert hint as [\"my-key\"] since 'my-key' is not a valid property name", function () {
                          var start = { line: 49, ch: 0 },
                              middle = { line: 49, ch: 5 },
                              end = { line: 49, ch: 13 };
          
          
          Severity: Major
          Found in src/extensions/default/JavaScriptCodeHints/unittests.js and 4 other locations - About 1 day to fix
          src/extensions/default/JavaScriptCodeHints/unittests.js on lines 722..737
          src/extensions/default/JavaScriptCodeHints/unittests.js on lines 757..771
          src/extensions/default/JavaScriptCodeHints/unittests.js on lines 1026..1040
          src/extensions/default/JavaScriptCodeHints/unittests.js on lines 1042..1056

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

          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 5 locations. Consider refactoring.
          Open

                      it("should insert hint as [\"my-key\"] make sure this works if nothing is typed after the '.'", function () {
                          var start = { line: 49, ch: 0 },
                              middle = { line: 49, ch: 4 },
                              end = { line: 49, ch: 13 };
          
          
          Severity: Major
          Found in src/extensions/default/JavaScriptCodeHints/unittests.js and 4 other locations - About 1 day to fix
          src/extensions/default/JavaScriptCodeHints/unittests.js on lines 722..737
          src/extensions/default/JavaScriptCodeHints/unittests.js on lines 757..771
          src/extensions/default/JavaScriptCodeHints/unittests.js on lines 1010..1024
          src/extensions/default/JavaScriptCodeHints/unittests.js on lines 1042..1056

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

          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

                      it("should display correct scopes for line inside a class expression", function () {
                          testEditor.setSelection({line: 112, ch: 8}, {line: 112, ch: 23});
          
                          var result = ExtractToFunction.handleExtractToFunction();
                          var scopeMenu;
          Severity: Major
          Found in src/extensions/default/JavaScriptRefactoring/unittests.js and 1 other location - About 1 day to fix
          src/extensions/default/JavaScriptRefactoring/unittests.js on lines 458..474

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

          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

                      it("should display correct scopes for line inside a class declaration", function () {
                          testEditor.setSelection({line: 93, ch: 8}, {line: 93, ch: 27});
          
                          var result = ExtractToFunction.handleExtractToFunction();
                          var scopeMenu;
          Severity: Major
          Found in src/extensions/default/JavaScriptRefactoring/unittests.js and 1 other location - About 1 day to fix
          src/extensions/default/JavaScriptRefactoring/unittests.js on lines 476..492

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

          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

                  if (showBaseUrlPrompt) {
                      // Prompt for a base URL
                      PreferencesDialogs.showProjectPreferencesDialog("", Strings.LIVE_DEV_NEED_BASEURL_MESSAGE)
                          .done(function (id) {
                              if (id === Dialogs.DIALOG_BTN_OK && ProjectManager.getBaseUrl()) {
          Severity: Major
          Found in src/LiveDevelopment/LiveDevelopment.js and 1 other location - About 1 day to fix
          src/LiveDevelopment/LiveDevMultiBrowser.js on lines 630..656

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

          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

                  if (showBaseUrlPrompt) {
                      // Prompt for a base URL
                      PreferencesDialogs.showProjectPreferencesDialog("", Strings.LIVE_DEV_NEED_BASEURL_MESSAGE)
                          .done(function (id) {
                              if (id === Dialogs.DIALOG_BTN_OK && ProjectManager.getBaseUrl()) {
          Severity: Major
          Found in src/LiveDevelopment/LiveDevMultiBrowser.js and 1 other location - About 1 day to fix
          src/LiveDevelopment/LiveDevelopment.js on lines 1282..1308

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

          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 ExtensionManager.js has 532 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          /*
           * Copyright (c) 2013 - 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: Major
          Found in src/extensibility/ExtensionManager.js - About 1 day to fix

            File strings.js has 532 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            /*
             * Copyright (c) 2014 - 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: Major
            Found in src/nls/sv/strings.js - About 1 day to fix

              Function HTMLDocumentModule has a Cognitive Complexity of 56 (exceeds 5 allowed). Consider refactoring.
              Open

              define(function HTMLDocumentModule(require, exports, module) {
                  "use strict";
              
                  var EditorManager       = require("editor/EditorManager"),
                      EventDispatcher     = require("utils/EventDispatcher"),
              Severity: Minor
              Found in src/LiveDevelopment/Documents/HTMLDocument.js - About 1 day 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

              Severity
              Category
              Status
              Source
              Language