adobe/brackets

View on GitHub

Showing 3,294 of 3,294 total issues

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

function init(domainManager) {
    if (!domainManager.hasDomain("extensionManager")) {
        domainManager.registerDomain("extensionManager", {major: 0, minor: 1});
    }
    domainManager.registerCommand(
Severity: Major
Found in src/extensibility/node/ExtensionManagerDomain.js - About 6 hrs to fix

    File ExtensionManagerDialog.js has 451 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: Minor
    Found in src/extensibility/ExtensionManagerDialog.js - About 6 hrs to fix

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

          function search(query, matcher) {
              var functionList = matcher.functionList;
              if (!functionList) {
                  functionList = createFunctionList();
                  matcher.functionList = functionList;
      Severity: Major
      Found in src/extensions/default/QuickOpenJavaScript/main.js and 1 other location - About 6 hrs to fix
      src/extensions/default/QuickOpenHTML/main.js on lines 91..112

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

      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

          function search(query, matcher) {
              var idList = matcher.idList;
              if (!idList) {
                  idList = createIDList();
                  matcher.idList = idList;
      Severity: Major
      Found in src/extensions/default/QuickOpenHTML/main.js and 1 other location - About 6 hrs to fix
      src/extensions/default/QuickOpenJavaScript/main.js on lines 80..101

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

      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

      Function open has 168 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          FindBar.prototype.open = function () {
              var self = this;
      
              // Normally, creating a new Find bar will simply cause the old one to close
              // automatically. This can cause timing issues because the focus change might
      Severity: Major
      Found in src/search/FindBar.js - About 6 hrs to fix

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

            DOMUpdater.prototype.getID = function (newTag, markCache) {
                // Get the mark at the start of the tagname (not before the beginning of the tag, because that's
                // actually inside the parent).
                var currentTagID = _getTagIDAtDocumentPos(this.editor, HTMLSimpleDOM._offsetPos(newTag.startPos, 1), markCache);
        
        
        Severity: Major
        Found in src/language/HTMLInstrumentation.js and 1 other location - About 6 hrs to fix
        src/LiveDevelopment/MultiBrowserImpl/language/HTMLInstrumentation.js on lines 311..329

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

        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 _updateDOM(previousDOM, editor, changeList) {
                if (!allowIncremental) {
                    changeList = undefined;
                }
                var updater = new DOMUpdater(previousDOM, editor, changeList);
        Severity: Major
        Found in src/language/HTMLInstrumentation.js and 1 other location - About 6 hrs to fix
        src/LiveDevelopment/MultiBrowserImpl/language/HTMLInstrumentation.js on lines 518..540

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

        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 _updateDOM(previousDOM, editor, changeList) {
                if (!allowIncremental) {
                    changeList = undefined;
                }
                var updater = new DOMUpdater(previousDOM, editor, changeList);
        src/language/HTMLInstrumentation.js on lines 549..571

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

        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

            DOMUpdater.prototype.getID = function (newTag, markCache) {
                // Get the mark at the start of the tagname (not before the beginning of the tag, because that's
                // actually inside the parent).
                var currentTagID = _getTagIDAtDocumentPos(this.editor, HTMLSimpleDOM._offsetPos(newTag.startPos, 1), markCache);
        
        
        src/language/HTMLInstrumentation.js on lines 342..360

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

        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

            _over: function(event) {
        
                var draggable = $.ui.ddmanager.current;
                if (!draggable || (draggable.currentItem || draggable.element)[0] == this.element[0]) return; // Bail if draggable and droppable are same element
        
        
        src/extensions/default/JavaScriptQuickEdit/unittest-files/jquery-ui/ui/jquery.ui.droppable.js on lines 93..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 169.

        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

            _out: function(event) {
        
                var draggable = $.ui.ddmanager.current;
                if (!draggable || (draggable.currentItem || draggable.element)[0] == this.element[0]) return; // Bail if draggable and droppable are same element
        
        
        src/extensions/default/JavaScriptQuickEdit/unittest-files/jquery-ui/ui/jquery.ui.droppable.js on lines 81..91

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

        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 445 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: Minor
        Found in src/extensions/default/UrlCodeHints/main.js - About 6 hrs to fix

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

                      it("should append brackets to a hint in case it in an array", function () {
                          testDocument.replaceRange("\"closeTags\": { \"\" }", {line: 25, ch: 4});
                          testEditor.setCursorPos({line: 25, ch: 20});
                          selectHint(PrefsCodeHints.hintProvider, "indentTags");
                          expectTokenAt({line: 25, ch: 30}, "\"indentTags\"", "string property");
          Severity: Major
          Found in src/extensions/default/PrefsCodeHints/unittests.js and 1 other location - About 6 hrs to fix
          src/extensions/default/PrefsCodeHints/unittests.js on lines 529..538

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

          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 append braces to a hint in case it is an object", function () {
                          testDocument.replaceRange("\"", {line: 25, ch: 4});
                          testEditor.setCursorPos({line: 25, ch: 5});
                          selectHint(PrefsCodeHints.hintProvider, "closeTags");
                          expectTokenAt({line: 25, ch: 14}, "\"closeTags\"", "string property");
          Severity: Major
          Found in src/extensions/default/PrefsCodeHints/unittests.js and 1 other location - About 6 hrs to fix
          src/extensions/default/PrefsCodeHints/unittests.js on lines 539..548

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

          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

          Function exports has 166 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          module.exports = function( grunt ) {
          
          var path = require( "path" );
          
          grunt.registerMultiTask( "copy", "Copy files to destination folder and replace @VERSION with pkg.version", function() {

            File CodeInspection.js has 441 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: Minor
            Found in src/language/CodeInspection.js - About 6 hrs to fix

              Function _generateHTML has 163 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  _generateHTML: function(inst) {
                      var today = new Date();
                      today = this._daylightSavingAdjust(
                          new Date(today.getFullYear(), today.getMonth(), today.getDate())); // clear time
                      var isRTL = this._get(inst, 'isRTL');

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

                            it("should hint in the center of a key", function () {
                                var hintList;
                
                                // In "language"
                                testEditor.setCursorPos({line: 9, ch: 9});
                Severity: Major
                Found in src/extensions/default/PrefsCodeHints/unittests.js and 7 other locations - About 6 hrs to fix
                src/extensions/default/PrefsCodeHints/unittests.js on lines 195..212
                src/extensions/default/PrefsCodeHints/unittests.js on lines 231..248
                src/extensions/default/PrefsCodeHints/unittests.js on lines 326..343
                src/extensions/default/PrefsCodeHints/unittests.js on lines 344..361
                src/extensions/default/PrefsCodeHints/unittests.js on lines 375..392
                src/extensions/default/PrefsCodeHints/unittests.js on lines 393..410
                src/extensions/default/PrefsCodeHints/unittests.js on lines 411..428

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

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

                            it("should hint at the end of a key", function () {
                                var hintList;
                
                                // Between "language and "
                                testEditor.setCursorPos({line: 9, ch: 13});
                Severity: Major
                Found in src/extensions/default/PrefsCodeHints/unittests.js and 7 other locations - About 6 hrs to fix
                src/extensions/default/PrefsCodeHints/unittests.js on lines 195..212
                src/extensions/default/PrefsCodeHints/unittests.js on lines 213..230
                src/extensions/default/PrefsCodeHints/unittests.js on lines 326..343
                src/extensions/default/PrefsCodeHints/unittests.js on lines 344..361
                src/extensions/default/PrefsCodeHints/unittests.js on lines 375..392
                src/extensions/default/PrefsCodeHints/unittests.js on lines 393..410
                src/extensions/default/PrefsCodeHints/unittests.js on lines 411..428

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

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

                            it("should hint at the end of the value", function () {
                                var hintList;
                
                                // After "closeBrackets": true
                                testEditor.setCursorPos({line: 1, ch: 25});
                Severity: Major
                Found in src/extensions/default/PrefsCodeHints/unittests.js and 7 other locations - About 6 hrs to fix
                src/extensions/default/PrefsCodeHints/unittests.js on lines 195..212
                src/extensions/default/PrefsCodeHints/unittests.js on lines 213..230
                src/extensions/default/PrefsCodeHints/unittests.js on lines 231..248
                src/extensions/default/PrefsCodeHints/unittests.js on lines 326..343
                src/extensions/default/PrefsCodeHints/unittests.js on lines 344..361
                src/extensions/default/PrefsCodeHints/unittests.js on lines 375..392
                src/extensions/default/PrefsCodeHints/unittests.js on lines 393..410

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

                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