adobe/brackets

View on GitHub

Showing 3,294 of 3,294 total issues

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

    function init() {
        CodeMirror.defineExtension("foldCode", function (pos, options, force) {
            return doFold(this, pos, options, force);
        });

Severity: Major
Found in src/extensions/default/CodeFolding/foldhelpers/foldcode.js - About 3 hrs to fix

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

                it("should list attribute value hints within an existing attribute value", function () {
                    testDocument.replaceRange(" dir=\"ltr\"", { line: 7, ch: 4 });  // insert dir="ltr" between <p and >
    
                    testEditor.setCursorPos({ line: 7, ch: 11 });       // set cursor right after dir="l
                    var hintList = expectHints(HTMLCodeHints.attrHintProvider);
    Severity: Major
    Found in src/extensions/default/HTMLCodeHints/unittests.js and 2 other locations - About 3 hrs to fix
    src/extensions/default/HTMLCodeHints/unittests.js on lines 367..373
    src/extensions/default/HTMLCodeHints/unittests.js on lines 381..387

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

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

                it("should list attribute value hints within an unquoted attribute value", function () {
                    testDocument.replaceRange(" dir=ltr", { line: 7, ch: 4 });  // insert dir=ltr between <p and >
    
                    testEditor.setCursorPos({ line: 7, ch: 10 });       // set cursor right after dir=l
                    var hintList = expectHints(HTMLCodeHints.attrHintProvider);
    Severity: Major
    Found in src/extensions/default/HTMLCodeHints/unittests.js and 2 other locations - About 3 hrs to fix
    src/extensions/default/HTMLCodeHints/unittests.js on lines 367..373
    src/extensions/default/HTMLCodeHints/unittests.js on lines 374..380

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

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

                it("should list attribute value hints for a single quote after the equal sign", function () {
                    testDocument.replaceRange(" dir='", { line: 7, ch: 4 });  // insert dir=' between <p and >
    
                    testEditor.setCursorPos({ line: 7, ch: 10 });       // set cursor right after dir='
                    var hintList = expectHints(HTMLCodeHints.attrHintProvider);
    Severity: Major
    Found in src/extensions/default/HTMLCodeHints/unittests.js and 2 other locations - About 3 hrs to fix
    src/extensions/default/HTMLCodeHints/unittests.js on lines 374..380
    src/extensions/default/HTMLCodeHints/unittests.js on lines 381..387

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

    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

                }, {
                    left: w * (this.bezier.coordinates[2]     * (1 - p[3] - p[1]) - p[3]) + "px",
                    top:  h * (1 - this.bezier.coordinates[3] * (1 - p[0] - p[2]) - p[0]) + "px"
                }];
    src/extensions/default/InlineTimingFunctionEditor/BezierCurveEditor.js on lines 104..107

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

    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

      $.fn.alert = function (option) {
        return this.each(function () {
          var $this = $(this)
            , data = $this.data('alert')
          if (!data) $this.data('alert', (data = new Alert(this)))
    Severity: Major
    Found in src/widgets/bootstrap-alerts.js and 1 other location - About 3 hrs to fix
    src/widgets/bootstrap-dropdown.js on lines 134..141

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

    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 filesRemoved(fileList) {
            if (FindUtils.isNodeSearchDisabled() || !fileList || fileList.length === 0) {
                return;
            }
            var updateObject = {
    Severity: Major
    Found in src/search/FindInFiles.js and 1 other location - About 3 hrs to fix
    src/search/FindInFiles.js on lines 674..686

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

    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

                return [{
                    left: w * (this.bezier.coordinates[0]     * (1 - p[3] - p[1]) - p[3]) + "px",
                    top:  h * (1 - this.bezier.coordinates[1] * (1 - p[0] - p[2]) - p[0]) + "px"
                }, {
    src/extensions/default/InlineTimingFunctionEditor/BezierCurveEditor.js on lines 107..110

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

    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 filesChanged(fileList) {
            if (FindUtils.isNodeSearchDisabled() || !fileList || fileList.length === 0) {
                return;
            }
            var updateObject = {
    Severity: Major
    Found in src/search/FindInFiles.js and 1 other location - About 3 hrs to fix
    src/search/FindInFiles.js on lines 692..704

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

    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

      $.fn.dropdown = function (option) {
        return this.each(function () {
          var $this = $(this)
            , data = $this.data('dropdown')
          if (!data) $this.data('dropdown', (data = new Dropdown(this)))
    Severity: Major
    Found in src/widgets/bootstrap-dropdown.js and 1 other location - About 3 hrs to fix
    src/widgets/bootstrap-alerts.js on lines 73..80

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

    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 Package.js has 327 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/Package.js - About 3 hrs to fix

      File HTMLSimpleDOM.js has 327 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: Minor
      Found in src/LiveDevelopment/MultiBrowserImpl/language/HTMLSimpleDOM.js - About 3 hrs to fix

        Function doOption has 96 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            function doOption() {
                var b, obj, filter, o = nexttoken.value, t, v;
                switch (o) {
                case '*/':
                    error("Unbegun comment.");

          Function matchOne has 96 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          Minimatch.prototype.matchOne = function (file, pattern, partial) {
            var options = this.options
          
            if (options.debug) {
              console.error("matchOne",
          Severity: Major
          Found in src/thirdparty/globmatch.js - About 3 hrs to fix

            File EditorManager.js has 326 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/editor/EditorManager.js - About 3 hrs to fix

              Function clean has 95 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  clean: function( elems, context, fragment, scripts ) {
                      var checkScriptType, script, j,
                              ret = [];
              
                      context = context || document;

                Function setListBounds has 95 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  function setListBounds(list, begin, end) {
                    // Sanitize begin & end using this shorthand for ToInt32(argument)
                    // http://www.ecma-international.org/ecma-262/6.0/#sec-toint32
                    if (begin !== undefined) {
                      begin = begin | 0;
                Severity: Major
                Found in src/thirdparty/immutable.js - About 3 hrs to fix

                  Function _onReady has 95 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      function _onReady() {
                          PerfUtils.addMeasurement("window.document Ready");
                  
                          // Let the user know Brackets doesn't run in a web browser yet
                          if (brackets.inBrowser) {
                  Severity: Major
                  Found in src/brackets.js - About 3 hrs to fix

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

                                it("should extract assignment expression", function () {
                                    testEditor.setSelection({line: 38, ch: 0}, {line: 38, ch: 6});
                    
                                    var prevDocLength = testDoc.getText().length;
                    
                    
                    Severity: Major
                    Found in src/extensions/default/JavaScriptRefactoring/unittests.js and 2 other locations - About 3 hrs to fix
                    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 305..315
                    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 317..327

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

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

                                it("should extract yield expression", function () {
                                    testEditor.setSelection({line: 84, ch: 8}, {line: 84, ch: 26});
                    
                                    var prevDocLength = testDoc.getText().length;
                    
                    
                    Severity: Major
                    Found in src/extensions/default/JavaScriptRefactoring/unittests.js and 2 other locations - About 3 hrs to fix
                    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 202..212
                    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 317..327

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

                    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