adobe/brackets

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

Summary

Maintainability
F
2 wks
Test Coverage

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

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

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

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

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 168.

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

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

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

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

    Refactorings

    Further Reading

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

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

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 168.

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

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

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

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

    Refactorings

    Further Reading

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

                it("should hint after a colon", function () {
                    var hintList;
    
                    // After "closeBrackets":
                    testEditor.setCursorPos({line: 1, ch: 20});
    Severity: Major
    Found in src/extensions/default/PrefsCodeHints/unittests.js and 7 other locations - About 6 hrs to fix
    src/extensions/default/PrefsCodeHints/unittests.js on lines 195..212
    src/extensions/default/PrefsCodeHints/unittests.js on lines 213..230
    src/extensions/default/PrefsCodeHints/unittests.js on lines 231..248
    src/extensions/default/PrefsCodeHints/unittests.js on lines 344..361
    src/extensions/default/PrefsCodeHints/unittests.js on lines 375..392
    src/extensions/default/PrefsCodeHints/unittests.js on lines 393..410
    src/extensions/default/PrefsCodeHints/unittests.js on lines 411..428

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 165.

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

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

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

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

    Refactorings

    Further Reading

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

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

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 165.

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

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

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

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

    Refactorings

    Further Reading

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

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

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 165.

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

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

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

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

    Refactorings

    Further Reading

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

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

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 165.

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

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

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

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

    Refactorings

    Further Reading

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

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

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 165.

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

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

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

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

    Refactorings

    Further Reading

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

                it("should hint after after a space followed by a colon", function () {
                    var hintList;
    
                    // After "closeBrackets":+space
                    testEditor.setCursorPos({line: 1, ch: 21});
    Severity: Major
    Found in src/extensions/default/PrefsCodeHints/unittests.js and 7 other locations - About 6 hrs to fix
    src/extensions/default/PrefsCodeHints/unittests.js on lines 195..212
    src/extensions/default/PrefsCodeHints/unittests.js on lines 213..230
    src/extensions/default/PrefsCodeHints/unittests.js on lines 231..248
    src/extensions/default/PrefsCodeHints/unittests.js on lines 326..343
    src/extensions/default/PrefsCodeHints/unittests.js on lines 375..392
    src/extensions/default/PrefsCodeHints/unittests.js on lines 393..410
    src/extensions/default/PrefsCodeHints/unittests.js on lines 411..428

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 165.

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

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

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

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

    Refactorings

    Further Reading

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

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

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 165.

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

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

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

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

    Refactorings

    Further Reading

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

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

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 165.

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

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

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

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

    Refactorings

    Further Reading

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

                it("should NOT hint for blacklisted parent keys", function () {
                    // Between " and txt"
                    testEditor.setCursorPos({line: 4, ch: 9});
                    expectNoHints(PrefsCodeHints.hintProvider);
    
    
    Severity: Major
    Found in src/extensions/default/PrefsCodeHints/unittests.js and 3 other locations - About 6 hrs to fix
    src/extensions/default/PrefsCodeHints/unittests.js on lines 268..284
    src/extensions/default/PrefsCodeHints/unittests.js on lines 285..301
    src/extensions/default/PrefsCodeHints/unittests.js on lines 451..467

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

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

                it("should NOT hint before initial quote of a key", function () {
                    // Before "closeBrackets"
                    testEditor.setCursorPos({line: 1, ch: 4});
                    expectNoHints(PrefsCodeHints.hintProvider);
    
    
    Severity: Major
    Found in src/extensions/default/PrefsCodeHints/unittests.js and 3 other locations - About 6 hrs to fix
    src/extensions/default/PrefsCodeHints/unittests.js on lines 250..266
    src/extensions/default/PrefsCodeHints/unittests.js on lines 285..301
    src/extensions/default/PrefsCodeHints/unittests.js on lines 451..467

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

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

                it("should NOT hint after final quote of a key", function () {
                    // After "closeBrackets"
                    testEditor.setCursorPos({line: 1, ch: 19});
                    expectNoHints(PrefsCodeHints.hintProvider);
    
    
    Severity: Major
    Found in src/extensions/default/PrefsCodeHints/unittests.js and 3 other locations - About 6 hrs to fix
    src/extensions/default/PrefsCodeHints/unittests.js on lines 250..266
    src/extensions/default/PrefsCodeHints/unittests.js on lines 268..284
    src/extensions/default/PrefsCodeHints/unittests.js on lines 451..467

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

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

                it("should NOT hint after a comma", function () {
                    // After "closeBrackets": true,
                    testEditor.setCursorPos({line: 1, ch: 26});
                    expectNoHints(PrefsCodeHints.hintProvider);
    
    
    Severity: Major
    Found in src/extensions/default/PrefsCodeHints/unittests.js and 3 other locations - About 6 hrs to fix
    src/extensions/default/PrefsCodeHints/unittests.js on lines 250..266
    src/extensions/default/PrefsCodeHints/unittests.js on lines 268..284
    src/extensions/default/PrefsCodeHints/unittests.js on lines 285..301

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

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

                it("should enter entire key after first letter of a key is typed", function () {
                    testDocument.replaceRange("\"c", {line: 25, ch: 4});
                    testEditor.setCursorPos({line: 25, ch: 6});
                    selectHint(PrefsCodeHints.hintProvider, "closeOthers.above");
                    expectTokenAt({line: 25, ch: 22}, "\"closeOthers.above\"", "string property");
    Severity: Major
    Found in src/extensions/default/PrefsCodeHints/unittests.js and 3 other locations - About 4 hrs to fix
    src/extensions/default/PrefsCodeHints/unittests.js on lines 497..504
    src/extensions/default/PrefsCodeHints/unittests.js on lines 513..520
    src/extensions/default/PrefsCodeHints/unittests.js on lines 521..528

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

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

                it("should enter entire key after few initial letters are typed", function () {
                    testDocument.replaceRange("\"close", {line: 25, ch: 4});
                    testEditor.setCursorPos({line: 25, ch: 10});
                    selectHint(PrefsCodeHints.hintProvider, "closeOthers.above");
                    expectTokenAt({line: 25, ch: 22}, "\"closeOthers.above\"", "string property");
    Severity: Major
    Found in src/extensions/default/PrefsCodeHints/unittests.js and 3 other locations - About 4 hrs to fix
    src/extensions/default/PrefsCodeHints/unittests.js on lines 497..504
    src/extensions/default/PrefsCodeHints/unittests.js on lines 505..512
    src/extensions/default/PrefsCodeHints/unittests.js on lines 521..528

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

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

                it("should enter entire key after initial quote is typed", function () {
                    testDocument.replaceRange("\"", {line: 25, ch: 4});
                    testEditor.setCursorPos({line: 25, ch: 5});
                    selectHint(PrefsCodeHints.hintProvider, "closeOthers.above");
                    expectTokenAt({line: 25, ch: 22}, "\"closeOthers.above\"", "string property");
    Severity: Major
    Found in src/extensions/default/PrefsCodeHints/unittests.js and 3 other locations - About 4 hrs to fix
    src/extensions/default/PrefsCodeHints/unittests.js on lines 505..512
    src/extensions/default/PrefsCodeHints/unittests.js on lines 513..520
    src/extensions/default/PrefsCodeHints/unittests.js on lines 521..528

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

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

                it("should replace existing key after few initial letter are typed", function () {
                    testDocument.replaceRange("\"closeOthers.above\": true,", {line: 25, ch: 4});
                    testEditor.setCursorPos({line: 25, ch: 17});
                    selectHint(PrefsCodeHints.hintProvider, "closeOthers.below");
                    expectTokenAt({line: 25, ch: 22}, "\"closeOthers.below\"", "string property");
    Severity: Major
    Found in src/extensions/default/PrefsCodeHints/unittests.js and 3 other locations - About 4 hrs to fix
    src/extensions/default/PrefsCodeHints/unittests.js on lines 497..504
    src/extensions/default/PrefsCodeHints/unittests.js on lines 505..512
    src/extensions/default/PrefsCodeHints/unittests.js on lines 513..520

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

    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("it should hint in brackets.json", function () {
                    testDocument.file._name = "brackets.json";
                    PrefsCodeHints._setupTestEnvironment(testDocument, testPreferences);
    
                    // Between " and closeBrackets"
    Severity: Major
    Found in src/extensions/default/PrefsCodeHints/unittests.js and 1 other location - About 3 hrs to fix
    src/extensions/default/PrefsCodeHints/unittests.js on lines 180..191

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

    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("it should NOT hint in other JSON files", function () {
                    testDocument.file._name = "package.json";
                    PrefsCodeHints._setupTestEnvironment(testDocument, testPreferences);
    
                    // Between " and closeBrackets"
    Severity: Major
    Found in src/extensions/default/PrefsCodeHints/unittests.js and 1 other location - About 3 hrs to fix
    src/extensions/default/PrefsCodeHints/unittests.js on lines 167..178

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

    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 replace current token when editing", function () {
                    testDocument.replaceRange("\"closeOthers.above\": tru", {line: 25, ch: 4});
                    testEditor.setCursorPos({line: 25, ch: 28});
                    selectHint(PrefsCodeHints.hintProvider, "true");
                    expectTokenAt({line: 25, ch: 28}, "true", "atom");
    Severity: Major
    Found in src/extensions/default/PrefsCodeHints/unittests.js and 2 other locations - About 3 hrs to fix
    src/extensions/default/PrefsCodeHints/unittests.js on lines 560..566
    src/extensions/default/PrefsCodeHints/unittests.js on lines 574..580

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

    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 insert a value of type Boolean", function () {
                    testDocument.replaceRange("\"closeOthers.above\":,", {line: 25, ch: 4});
                    testEditor.setCursorPos({line: 25, ch: 24});
                    selectHint(PrefsCodeHints.hintProvider, "true");
                    expectTokenAt({line: 25, ch: 28}, "true", "atom");
    Severity: Major
    Found in src/extensions/default/PrefsCodeHints/unittests.js and 2 other locations - About 3 hrs to fix
    src/extensions/default/PrefsCodeHints/unittests.js on lines 567..573
    src/extensions/default/PrefsCodeHints/unittests.js on lines 574..580

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

    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 insert a value of type String", function () {
                    testDocument.replaceRange(",\n        \"pavement\":", {line: 7, ch: 32});
                    testEditor.setCursorPos({line: 8, ch: 19});
                    selectHint(PrefsCodeHints.hintProvider, "python");
                    expectTokenAt({line: 8, ch: 27}, "\"python\"", "string");
    Severity: Major
    Found in src/extensions/default/PrefsCodeHints/unittests.js and 2 other locations - About 3 hrs to fix
    src/extensions/default/PrefsCodeHints/unittests.js on lines 560..566
    src/extensions/default/PrefsCodeHints/unittests.js on lines 567..573

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

    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 NOT hint before opening braces", function () {
                    // Between "javascript": and {
                    testEditor.setCursorPos({line: 10, ch: 22});
                    expectNoHints(PrefsCodeHints.hintProvider);
    
    
    Severity: Major
    Found in src/extensions/default/PrefsCodeHints/unittests.js and 1 other location - About 2 hrs to fix
    src/extensions/default/PrefsCodeHints/unittests.js on lines 477..485

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

    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 NOT hint after closing braces", function () {
                    // After "javascript": { [rules] }
                    testEditor.setCursorPos({line: 13, ch: 9});
                    expectNoHints(PrefsCodeHints.hintProvider);
    
    
    Severity: Major
    Found in src/extensions/default/PrefsCodeHints/unittests.js and 1 other location - About 2 hrs to fix
    src/extensions/default/PrefsCodeHints/unittests.js on lines 468..476

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

    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 expectCursorAt(pos) {
                var selection = testEditor.getSelection();
                expect(fixPos(selection.start)).toEqual(fixPos(selection.end));
                expect(fixPos(selection.start)).toEqual(fixPos(pos));
            }
    Severity: Major
    Found in src/extensions/default/PrefsCodeHints/unittests.js and 1 other location - About 2 hrs to fix
    src/extensions/default/SVGCodeHints/unittests.js on lines 119..123

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

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

    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

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

            function verifyHintsExcluded(hintList, unexpectedHint) {
                var hints = extractHintList(hintList);
                expect(hints.indexOf(unexpectedHint)).toBe(-1);
            }
    Severity: Minor
    Found in src/extensions/default/PrefsCodeHints/unittests.js and 1 other location - About 45 mins to fix
    src/extensions/default/SVGCodeHints/unittests.js on lines 90..93

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

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

                it("should NOT hint after closing brackets", function () {
                    testEditor.setCursorPos({line: 10, ch: 22});
                    expectNoHints(PrefsCodeHints.hintProvider);
                });
    Severity: Major
    Found in src/extensions/default/PrefsCodeHints/unittests.js and 5 other locations - About 35 mins to fix
    src/extensions/default/HTMLCodeHints/unittests.js on lines 190..193
    src/extensions/default/HTMLCodeHints/unittests.js on lines 273..276
    src/extensions/default/HTMLCodeHints/unittests.js on lines 351..354
    src/extensions/default/JavaScriptCodeHints/unittests.js on lines 479..482
    src/extensions/default/PrefsCodeHints/unittests.js on lines 486..489

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

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

                it("should NOT hint before opening brackets", function () {
                    testEditor.setCursorPos({line: 10, ch: 22});
                    expectNoHints(PrefsCodeHints.hintProvider);
                });
    Severity: Major
    Found in src/extensions/default/PrefsCodeHints/unittests.js and 5 other locations - About 35 mins to fix
    src/extensions/default/HTMLCodeHints/unittests.js on lines 190..193
    src/extensions/default/HTMLCodeHints/unittests.js on lines 273..276
    src/extensions/default/HTMLCodeHints/unittests.js on lines 351..354
    src/extensions/default/JavaScriptCodeHints/unittests.js on lines 479..482
    src/extensions/default/PrefsCodeHints/unittests.js on lines 490..493

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

    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

            testContent =   "{\n" +
                            "    \"closeBrackets\": true,\n" +
                            "    \"insertHintOnTab\": false,\n" +
                            "    \"language.fileExtensions\": {\n" +
                            "        \"txt\": \"markdown\"\n" +
    Severity: Minor
    Found in src/extensions/default/PrefsCodeHints/unittests.js and 1 other location - About 30 mins to fix
    src/extensions/default/CSSCodeHints/unittests.js on lines 375..386

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

    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