adobe/brackets

View on GitHub

Showing 3,294 of 3,294 total issues

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

        function expectHints(provider) {
            expect(provider.hasHints(testEditor, null)).toBe(true);
            var hintObj = provider.getHints();
            expect(hintObj).toBeTruthy();
            return hintObj.hints;
Severity: Major
Found in src/extensions/default/PrefsCodeHints/unittests.js and 1 other location - About 1 hr to fix
src/extensions/default/SVGCodeHints/unittests.js on lines 71..76

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

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

                        curScope.name = "function starting with " +
                            fullText.substr(
                                curScope.originNode.body.start,
                                Math.min(
                                    FUNCTION_BODY_PREFIX_LENGTH,
src/extensions/default/JavaScriptRefactoring/RefactoringUtils.js on lines 402..409

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

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

                var left = o.grid[0] ? this.originalPageX + Math.round((pageX - this.originalPageX) / o.grid[0]) * o.grid[0] : this.originalPageX;
src/extensions/default/JavaScriptQuickEdit/unittest-files/jquery-ui/ui/jquery.ui.draggable.js on lines 448..448

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

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 expectTokenAt(pos, string, type) {
            var token = testEditor._codeMirror.getTokenAt(pos);
            expect(token.string).toBe(string);
            expect(token.type).toBe(type);
        }
Severity: Major
Found in src/extensions/default/PrefsCodeHints/unittests.js and 1 other location - About 1 hr to fix
src/extensions/default/SVGCodeHints/unittests.js on lines 104..108

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

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

                        curScope.name = "function starting with " +
                            fullText.substr(
                                curScope.originNode.body.start,
                                Math.min(
                                    FUNCTION_BODY_PREFIX_LENGTH,
src/extensions/default/JavaScriptRefactoring/RefactoringUtils.js on lines 390..397

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

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

    LiveDocument.prototype._attachToEditor = function (editor) {
        this.editor = editor;

        if (this.editor) {
            this.editor.on("cursorActivity", this._onCursorActivity);
src/LiveDevelopment/Documents/CSSPreprocessorDocument.js on lines 80..87

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

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 expectTokenAt(pos, string, type) {
            var token = testEditor._codeMirror.getTokenAt(pos);
            expect(token.string).toBe(string);
            expect(token.type).toBe(type);
        }
Severity: Major
Found in src/extensions/default/SVGCodeHints/unittests.js and 1 other location - About 1 hr to fix
src/extensions/default/PrefsCodeHints/unittests.js on lines 135..139

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

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 FileLocation(fullPath, line, chFrom, chTo, id) {
        this.fullPath = fullPath;
        this.line = line;
        this.chFrom = chFrom;
        this.chTo = chTo;
Severity: Major
Found in src/extensions/default/QuickOpenHTML/main.js and 1 other location - About 1 hr to fix
src/extensions/default/QuickOpenJavaScript/main.js on lines 44..50

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

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 _getRelativeMenuItem has 46 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    Menu.prototype._getRelativeMenuItem = function (relativeID, position) {
        var $relativeElement;

        if (relativeID) {
            if (position === FIRST_IN_SECTION || position === LAST_IN_SECTION) {
Severity: Minor
Found in src/command/Menus.js - About 1 hr to fix

    Function load has 46 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        MultiRangeInlineEditor.prototype.load = function (hostEditor) {
            MultiRangeInlineEditor.prototype.parentClass.load.apply(this, arguments);
    
            // Create the message area
            this.$messageDiv = $("<div/>")
    Severity: Minor
    Found in src/editor/MultiRangeInlineEditor.js - About 1 hr to fix

      Function validateChecksum has 46 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          function validateChecksum(requester, params) {
              params = params || {
                  filePath: installerPath,
                  expectedChecksum: _updateParams.checksum
              };
      Severity: Minor
      Found in src/extensions/default/AutoUpdate/node/AutoUpdateDomain.js - About 1 hr to fix

        Function toHaveInlineEditorRange has 46 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                            toHaveInlineEditorRange: function (range) {
                                var i = 0,
                                    editor = this.actual,
                                    hidden,
                                    lineCount = editor.lineCount(),
        Severity: Minor
        Found in src/extensions/default/JavaScriptQuickEdit/unittests.js - About 1 hr to fix

          Function fold has 46 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          $.effects.effect.fold = function( o, done ) {
          
              // Create element
              var el = $( this ),
                  props = [ "position", "top", "bottom", "left", "right", "height", "width" ],

            Function drag has 46 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                drag: function(event, ui) {
            
                    var inst = $(this).data("draggable"), that = this;
            
                    var checkPos = function(o) {

              Function ajaxHandleResponses has 46 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function ajaxHandleResponses( s, jqXHR, responses ) {
              
                  var contents = s.contents,
                      dataTypes = s.dataTypes,
                      responseFields = s.responseFields,

                Function extract has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    function extract(scopes, parentStatement, expns, text, insertPosition) {
                        var varType          = "var",
                            varName          = RefactoringUtils.getUniqueIdentifierName(scopes, "extracted"),
                            varDeclaration   = varType + " " + varName + " = " + text + ";\n",
                            parentStatementStartPos = session.editor.posFromIndex(parentStatement.start),
                Severity: Minor
                Found in src/extensions/default/JavaScriptRefactoring/ExtractToVariable.js - About 1 hr to fix

                  Function tokenize has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  tokenize = Sizzle.tokenize = function( selector, parseOnly ) {
                      var matched, match, tokens, type,
                          soFar, groups, preFilters,
                          cached = tokenCache[ selector + " " ];
                  
                  
                  Severity: Minor
                  Found in src/thirdparty/jquery-2.1.3.js - About 1 hr to fix

                    Function matcherFromTokens has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    function matcherFromTokens( tokens ) {
                        var checkContext, matcher, j,
                            len = tokens.length,
                            leadingRelative = Expr.relative[ tokens[0].type ],
                            implicitRelative = leadingRelative || Expr.relative[" "],
                    Severity: Minor
                    Found in src/thirdparty/jquery-2.1.3.js - About 1 hr to fix

                      Function deepEqual has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        function deepEqual(a, b) {
                          if (a === b) {
                            return true;
                          }
                      
                      
                      Severity: Minor
                      Found in src/thirdparty/immutable.js - About 1 hr to fix

                        Function _keydownHook has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            var _keydownHook = function (e, autoDismiss) {
                                var $primaryBtn     = this.find(".primary"),
                                    buttonId        = null,
                                    which           = String.fromCharCode(e.which),
                                    $focusedElement = this.find(".dialog-button:focus, a:focus");
                        Severity: Minor
                        Found in src/widgets/Dialogs.js - About 1 hr to fix
                          Severity
                          Category
                          Status
                          Source
                          Language