adobe/brackets

View on GitHub

Showing 3,294 of 3,294 total issues

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

                                appshell.fs.moveToTrash(path, function (err) {
                                    if (err) {
                                        console.log("Cannot move unparseable preferences file " + path + " to trash!!");
                                    } else {
                                        console.log("Brackets has recreated the Invalid JSON preferences file " + path + ". You may refer to the deleted file in trash in case you need it!!");
Severity: Major
Found in src/preferences/PreferencesBase.js and 1 other location - About 2 hrs to fix
src/preferences/PreferencesBase.js on lines 184..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 78.

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

                    fileList.forEach(function (file) {
                        if (_findFileInMRUList(pane.id, file) !== -1) {
                            console.log(file.fullPath + " duplicated in mru list");
                        }
                        _mruList.push(_makeMRUListEntry(file, pane.id));
Severity: Major
Found in src/view/MainViewManager.js and 1 other location - About 2 hrs to fix
src/view/MainViewManager.js on lines 752..757

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

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

                runs(function () {
                    checkColorAtPos("blueviolet",    47, 15);
                    checkColorAtPos("darkgoldenrod", 49, 16);
                    checkColorAtPos("darkgray",      50, 16);
                    checkColorAtPos("firebrick",     51, 15);
Severity: Major
Found in src/extensions/default/QuickView/unittests.js and 1 other location - About 2 hrs to fix
src/extensions/default/QuickView/unittests.js on lines 477..486

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

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

        uniqueFileList.forEach(function (file) {
            if (_findFileInMRUList(pane.id, file) !== -1) {
                console.log(file.fullPath + " duplicated in mru list");
            }
            _mruList.push(_makeMRUListEntry(file, pane.id));
Severity: Major
Found in src/view/MainViewManager.js and 1 other location - About 2 hrs to fix
src/view/MainViewManager.js on lines 1538..1543

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

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 show image preview for URLs with known image extensions", function () {
                checkImageDataAtPos("http://example.com/image.gif", 194, 20);
                checkImageDataAtPos("http://example.com/image.png", 195, 20);
                checkImageDataAtPos("http://example.com/image.jpe", 196, 20);
                checkImageDataAtPos("http://example.com/image.jpeg", 197, 20);
Severity: Major
Found in src/extensions/default/QuickView/unittests.js and 1 other location - About 2 hrs to fix
src/extensions/default/QuickView/unittests.js on lines 180..189

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

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

                                appshell.fs.moveToTrash(path, function (err) {
                                    if (err) {
                                        console.log("Cannot move unreadable preferences file " + path + " to trash!!");
                                    } else {
                                        console.log("Brackets has recreated the unreadable preferences file " + path + ". You may refer to the deleted file in trash in case you need it!!");
Severity: Major
Found in src/preferences/PreferencesBase.js and 1 other location - About 2 hrs to fix
src/preferences/PreferencesBase.js on lines 210..216

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

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

                            FileUtils.writeText(file, prefsString, true)
                                .done(function () {
                                    recomputeDefaultPrefs = false;
                                    _openPrefFilesInSplitView(prefsPath, defaultPrefsPath, deferredPromise);
                                }).fail(function (error) {
Severity: Major
Found in src/extensions/default/DebugCommands/main.js and 1 other location - About 2 hrs to fix
src/extensions/default/DebugCommands/main.js on lines 710..718

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

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

/* ===========================================================
 * bootstrap-tooltip.js v2.3.1
 * http://twitter.github.com/bootstrap/javascript.html#tooltips
 * Inspired by the original jQuery.tipsy by Jason Frame
 * ===========================================================
Severity: Minor
Found in src/widgets/bootstrap-tooltip.js - About 2 hrs to fix

    Function _installEditorListeners has 53 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        Editor.prototype._installEditorListeners = function () {
            var self = this;
    
            // Redispatch these CodeMirror key events as Editor events
            function _onKeyEvent(instance, event) {
    Severity: Major
    Found in src/editor/Editor.js - About 2 hrs to fix

      Function handleTernGetFile has 53 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              function handleTernGetFile(request) {
      
                  function replyWith(name, txt) {
                      _postMessageByPass({
                          type: MessageIds.TERN_GET_FILE_MSG,
      Severity: Major
      Found in src/JSUtils/ScopeManager.js - About 2 hrs to fix

        File foldgutter.js has 255 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        // CodeMirror, copyright (c) by Marijn Haverbeke and others
        // Distributed under an MIT license: http://codemirror.net/LICENSE
        // Based on http://codemirror.net/addon/fold/foldgutter.js
        // Modified by Patrick Oladimeji for Brackets
        
        
        Severity: Minor
        Found in src/extensions/default/CodeFolding/foldhelpers/foldgutter.js - About 2 hrs to fix

          Function _generateMonthYearHeader has 53 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              _generateMonthYearHeader: function(inst, drawMonth, drawYear, minDate, maxDate,
                      secondary, monthNames, monthNamesShort) {
                  var changeMonth = this._get(inst, 'changeMonth');
                  var changeYear = this._get(inst, 'changeYear');
                  var showMonthAfterYear = this._get(inst, 'showMonthAfterYear');

            Function render has 53 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    render: function () {
                        var selectionBackground = fileSelectionBox({
                            ref: "selectionBackground",
                            selectionViewInfo: this.props.selectionViewInfo,
                            className: "filetree-selection",
            Severity: Major
            Found in src/project/FileTreeView.js - About 2 hrs to fix

              File Async.js has 255 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/utils/Async.js - About 2 hrs to fix

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

                    data: function( key, value ) {
                        var i, name, data,
                            elem = this[ 0 ],
                            attrs = elem && elem.attributes;
                
                
                Severity: Major
                Found in src/thirdparty/jquery-2.1.3.js - About 2 hrs to fix

                  Function send has 53 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                              send: function( headers, complete ) {
                                  var i,
                                      xhr = options.xhr(),
                                      id = ++xhrId;
                  
                  
                  Severity: Major
                  Found in src/thirdparty/jquery-2.1.3.js - About 2 hrs to fix

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

                        unwrap: function() {
                            return this.parent().each(function() {
                                if ( !jQuery.nodeName( this, "body" ) ) {
                                    jQuery( this ).replaceWith( this.childNodes );
                                }
                    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 5836..5842

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

                    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 2 value-name hints for region-fragment", function () {
                                    testEditor.setCursorPos({ line: 3, ch: 18 });    // after region-fragment
                                    var hintList = expectHints(CSSCodeHints.cssPropHintProvider);
                                    verifyAttrHints(hintList, "auto");  // first hint should be auto
                                    verifyAllValues(hintList, ["auto", "break"]);
                    Severity: Major
                    Found in src/extensions/default/CSSCodeHints/unittests.js and 2 other locations - About 2 hrs to fix
                    src/extensions/default/CSSCodeHints/unittests.js on lines 678..683
                    src/extensions/default/CSSCodeHints/unittests.js on lines 799..804

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

                    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 2 value-name hints for flow-from", function () {
                                    testEditor.setCursorPos({ line: 9, ch: 12 });    // after flow-from
                                    var hintList = expectHints(CSSCodeHints.cssPropHintProvider);
                                    verifyAttrHints(hintList, "inherit");  // first hint should be inherit
                                    verifyAllValues(hintList, ["inherit", "none"]);
                    Severity: Major
                    Found in src/extensions/default/CSSCodeHints/unittests.js and 2 other locations - About 2 hrs to fix
                    src/extensions/default/CSSCodeHints/unittests.js on lines 637..642
                    src/extensions/default/CSSCodeHints/unittests.js on lines 799..804

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

                    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

                            DocumentManager.getDocumentForPath(newFilePath)
                                .done(function (newDoc) {
                                    newDoc.on("languageChanged.reference-in-files", function () {
                                        var changedLanguageId = LanguageManager.getLanguageForPath(newDoc.file.fullPath).getId();
                                        setMenuItemStateForLanguage(changedLanguageId);
                    Severity: Major
                    Found in src/features/FindReferencesManager.js and 1 other location - About 2 hrs to fix
                    src/search/QuickOpen.js on lines 830..836

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

                    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