adobe/brackets

View on GitHub
src/extensions/default/JavaScriptRefactoring/unittests.js

Summary

Maintainability
F
3 wks
Test Coverage

File unittests.js has 568 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*
 * Copyright (c) 2013 - present Adobe Systems Incorporated. All rights reserved.
 *
 * Permission is hereby granted, free of charge, to any person obtaining a
 * copy of this software and associated documentation files (the "Software"),
Severity: Major
Found in src/extensions/default/JavaScriptRefactoring/unittests.js - About 1 day to fix

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

                it("should extract a line inside a class to a class method", function () {
                    testEditor.setSelection({line: 104, ch: 8}, {line: 104, ch: 29});
    
                    var prevDocLength = testDoc.getText().length;
                    var result = ExtractToFunction.handleExtractToFunction();
    Severity: Major
    Found in src/extensions/default/JavaScriptRefactoring/unittests.js and 1 other location - About 1 day to fix
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 574..601

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

    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 extract a line inside a class to global scope", function () {
                    testEditor.setSelection({line: 104, ch: 8}, {line: 104, ch: 29});
    
                    var prevDocLength = testDoc.getText().length;
                    var result = ExtractToFunction.handleExtractToFunction();
    Severity: Major
    Found in src/extensions/default/JavaScriptRefactoring/unittests.js and 1 other location - About 1 day to fix
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 545..572

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

    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 rename function name", function() {
                    testEditor.setSelection({line: 140, ch: 17}, {line: 140, ch: 17});
    
                    var selections = testEditor.getSelections();
    
    
    Severity: Major
    Found in src/extensions/default/JavaScriptRefactoring/unittests.js and 1 other location - About 1 day to fix
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 632..648

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

    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 rename variable name", function() {
                    testEditor.setSelection({line: 165, ch: 6}, {line: 165, ch: 6});
    
                    var selections = testEditor.getSelections();
    
    
    Severity: Major
    Found in src/extensions/default/JavaScriptRefactoring/unittests.js and 1 other location - About 1 day to fix
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 614..630

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

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

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

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

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 212.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

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

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

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 212.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

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

                it("should display correct scopes for line inside a arrow function", function () {
                    testEditor.setSelection({line: 58, ch: 4}, {line: 58, ch: 17});
    
                    var result = ExtractToFunction.handleExtractToFunction();
                    var scopeMenu;
    Severity: Major
    Found in src/extensions/default/JavaScriptRefactoring/unittests.js and 2 other locations - About 7 hrs to fix
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 388..403
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 405..420

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

    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 display correct scopes for line inside a function declaration", function () {
                    testEditor.setSelection({line: 7, ch: 4}, {line: 7, ch: 28});
    
                    var result = ExtractToFunction.handleExtractToFunction();
                    var scopeMenu;
    Severity: Major
    Found in src/extensions/default/JavaScriptRefactoring/unittests.js and 2 other locations - About 7 hrs to fix
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 405..420
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 422..437

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

    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 display correct scopes for line inside a function expression", function () {
                    testEditor.setSelection({line: 27, ch: 4}, {line: 27, ch: 31});
    
                    var result = ExtractToFunction.handleExtractToFunction();
                    var scopeMenu;
    Severity: Major
    Found in src/extensions/default/JavaScriptRefactoring/unittests.js and 2 other locations - About 7 hrs to fix
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 388..403
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 422..437

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

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

                it("should extract binary expression", function () {
                    testEditor.setSelection({line: 34, ch: 4}, {line: 34, ch: 13});
    
                    var prevDocLength = testDoc.getText().length;
    
    
    Severity: Major
    Found in src/extensions/default/JavaScriptRefactoring/unittests.js and 12 other locations - About 4 hrs to fix
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 100..111
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 113..124
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 145..156
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 176..187
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 214..225
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 227..238
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 240..251
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 253..264
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 266..277
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 279..290
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 292..303
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 365..376

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

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

                it("should create variable with unique name", function() {
                    testEditor.setSelection({line: 126, ch: 12}, {line: 126, ch: 14});
    
                    var prevDocLength = testDoc.getText().length;
    
    
    Severity: Major
    Found in src/extensions/default/JavaScriptRefactoring/unittests.js and 12 other locations - About 4 hrs to fix
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 100..111
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 113..124
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 145..156
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 176..187
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 189..200
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 214..225
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 227..238
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 240..251
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 253..264
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 266..277
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 279..290
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 292..303

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

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

                it("should extract literal expression", function () {
                    testEditor.setSelection({line: 11, ch: 4}, {line: 11, ch: 7});
    
                    var prevDocLength = testDoc.getText().length;
    
    
    Severity: Major
    Found in src/extensions/default/JavaScriptRefactoring/unittests.js and 12 other locations - About 4 hrs to fix
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 113..124
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 145..156
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 176..187
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 189..200
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 214..225
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 227..238
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 240..251
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 253..264
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 266..277
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 279..290
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 292..303
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 365..376

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

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

                it("should extract property expression", function () {
                    testEditor.setSelection({line: 23, ch: 4}, {line: 23, ch: 11});
    
                    var prevDocLength = testDoc.getText().length;
    
    
    Severity: Major
    Found in src/extensions/default/JavaScriptRefactoring/unittests.js and 12 other locations - About 4 hrs to fix
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 100..111
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 113..124
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 176..187
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 189..200
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 214..225
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 227..238
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 240..251
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 253..264
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 266..277
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 279..290
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 292..303
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 365..376

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

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

                it("should extract conditional expression", function () {
                    testEditor.setSelection({line: 44, ch: 4}, {line: 44, ch: 19});
    
                    var prevDocLength = testDoc.getText().length;
    
    
    Severity: Major
    Found in src/extensions/default/JavaScriptRefactoring/unittests.js and 12 other locations - About 4 hrs to fix
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 100..111
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 113..124
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 145..156
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 176..187
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 189..200
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 214..225
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 240..251
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 253..264
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 266..277
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 279..290
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 292..303
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 365..376

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

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

                it("should extract template literal", function () {
                    testEditor.setSelection({line: 62, ch: 4}, {line: 62, ch: 22});
    
                    var prevDocLength = testDoc.getText().length;
    
    
    Severity: Major
    Found in src/extensions/default/JavaScriptRefactoring/unittests.js and 12 other locations - About 4 hrs to fix
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 100..111
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 113..124
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 145..156
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 176..187
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 189..200
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 214..225
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 227..238
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 240..251
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 253..264
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 279..290
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 292..303
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 365..376

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

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

                it("should extract array expression", function () {
                    testEditor.setSelection({line: 14, ch: 4}, {line: 14, ch: 13});
    
                    var prevDocLength = testDoc.getText().length;
    
    
    Severity: Major
    Found in src/extensions/default/JavaScriptRefactoring/unittests.js and 12 other locations - About 4 hrs to fix
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 100..111
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 145..156
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 176..187
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 189..200
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 214..225
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 227..238
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 240..251
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 253..264
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 266..277
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 279..290
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 292..303
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 365..376

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

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

                it("should extract unary expression", function () {
                    testEditor.setSelection({line: 31, ch: 4}, {line: 31, ch: 7});
    
                    var prevDocLength = testDoc.getText().length;
    
    
    Severity: Major
    Found in src/extensions/default/JavaScriptRefactoring/unittests.js and 12 other locations - About 4 hrs to fix
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 100..111
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 113..124
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 145..156
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 189..200
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 214..225
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 227..238
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 240..251
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 253..264
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 266..277
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 279..290
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 292..303
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 365..376

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

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

                it("should extract new expression", function () {
                    testEditor.setSelection({line: 50, ch: 4}, {line: 50, ch: 16});
    
                    var prevDocLength = testDoc.getText().length;
    
    
    Severity: Major
    Found in src/extensions/default/JavaScriptRefactoring/unittests.js and 12 other locations - About 4 hrs to fix
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 100..111
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 113..124
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 145..156
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 176..187
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 189..200
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 214..225
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 227..238
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 253..264
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 266..277
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 279..290
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 292..303
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 365..376

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

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

                it("should extract await expression", function () {
                    testEditor.setSelection({line: 77, ch: 12}, {line: 77, ch: 42});
    
                    var prevDocLength = testDoc.getText().length;
    
    
    Severity: Major
    Found in src/extensions/default/JavaScriptRefactoring/unittests.js and 12 other locations - About 4 hrs to fix
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 100..111
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 113..124
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 145..156
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 176..187
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 189..200
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 214..225
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 227..238
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 240..251
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 253..264
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 266..277
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 279..290
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 365..376

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

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

                it("should extract assignment expression", function () {
                    testEditor.setSelection({line: 41, ch: 3}, {line: 41, ch: 17});
    
                    var prevDocLength = testDoc.getText().length;
    
    
    Severity: Major
    Found in src/extensions/default/JavaScriptRefactoring/unittests.js and 12 other locations - About 4 hrs to fix
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 100..111
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 113..124
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 145..156
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 176..187
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 189..200
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 227..238
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 240..251
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 253..264
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 266..277
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 279..290
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 292..303
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 365..376

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

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

                it("should extract arrow function", function () {
                    testEditor.setSelection({line: 56, ch: 4}, {line: 56, ch: 16});
    
                    var prevDocLength = testDoc.getText().length;
    
    
    Severity: Major
    Found in src/extensions/default/JavaScriptRefactoring/unittests.js and 12 other locations - About 4 hrs to fix
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 100..111
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 113..124
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 145..156
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 176..187
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 189..200
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 214..225
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 227..238
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 240..251
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 266..277
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 279..290
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 292..303
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 365..376

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

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

                it("should extract tagged template literal", function () {
                    testEditor.setSelection({line: 65, ch: 4}, {line: 65, ch: 29});
    
                    var prevDocLength = testDoc.getText().length;
    
    
    Severity: Major
    Found in src/extensions/default/JavaScriptRefactoring/unittests.js and 12 other locations - About 4 hrs to fix
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 100..111
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 113..124
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 145..156
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 176..187
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 189..200
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 214..225
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 227..238
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 240..251
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 253..264
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 266..277
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 292..303
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 365..376

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

    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 convert selected function to arrow function with two param and two statements", function() {
                    testEditor.setSelection({line: 154, ch: 6}, {line: 154, ch: 6});
    
                    var prevDoc = testDoc.getText();
    
    
    Severity: Major
    Found in src/extensions/default/JavaScriptRefactoring/unittests.js and 2 other locations - About 4 hrs to fix
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 700..710
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 712..722

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

    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 convert selected function to arrow function with two param and one return statement", function() {
                    testEditor.setSelection({line: 146, ch: 6}, {line: 146, ch: 6});
    
                    var prevDoc = testDoc.getText();
    
    
    Severity: Major
    Found in src/extensions/default/JavaScriptRefactoring/unittests.js and 2 other locations - About 4 hrs to fix
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 712..722
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 724..734

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

    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 convert selected function to arrow function with one param and one return statement", function() {
                    testEditor.setSelection({line: 150, ch: 6}, {line: 150, ch: 6});
    
                    var prevDoc = testDoc.getText();
    
    
    Severity: Major
    Found in src/extensions/default/JavaScriptRefactoring/unittests.js and 2 other locations - About 4 hrs to fix
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 700..710
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 724..734

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

    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 super expression", function () {
                    testEditor.setSelection({line: 103, ch: 8}, {line: 103, ch: 29});
    
                    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 305..315

    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

    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

        var MainViewManager      = brackets.getModule("view/MainViewManager"),
            DocumentManager      = brackets.getModule("document/DocumentManager"),
            FileUtils            = brackets.getModule("file/FileUtils"),
            SpecRunnerUtils      = brackets.getModule("spec/SpecRunnerUtils"),
            Strings              = brackets.getModule("strings"),
    Severity: Major
    Found in src/extensions/default/JavaScriptRefactoring/unittests.js and 2 other locations - About 2 hrs to fix
    src/extensions/default/JavaScriptRefactoring/RenameIdentifier.js on lines 27..33
    src/extensions/default/OpenWithExternalApplication/GraphicsFile.js on lines 28..34

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

    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

                        expect(testDoc.getRange({line: 4, ch: 0}, {line: 7, ch: 1}))
                            .toBe(
                                "function extracted1() {\n" +
                                "    var y = 34;\n"     +
                                "    return y;\n"      +
    Severity: Major
    Found in src/extensions/default/JavaScriptRefactoring/unittests.js and 1 other location - About 1 hr to fix
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 134..140

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

    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

                        expect(testDoc.getRange({line: 17, ch: 0}, {line: 20, ch: 2}))
                            .toBe(
                                "var extracted1 = {\n" +
                                "    test1: 12,\n"     +
                                "    test2: 45\n"      +
    Severity: Major
    Found in src/extensions/default/JavaScriptRefactoring/unittests.js and 1 other location - About 1 hr to fix
    src/extensions/default/JavaScriptRefactoring/unittests.js on lines 506..512

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

    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

    There are no issues that match your filters.

    Category
    Status