adobe/brackets

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

Summary

Maintainability
F
2 wks
Test Coverage

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

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

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

                it("should insert a new atribute with an empty value before the existing valueless attribute", function () {
                    testDocument.replaceRange("  <input checked>\n", { line: 9, ch: 0 });  // insert new line
    
                    testEditor.setCursorPos({ line: 9, ch: 9 });    // cursor after trailing space
                    selectHint(HTMLCodeHints.attrHintProvider, "class");
    Severity: Major
    Found in src/extensions/default/HTMLCodeHints/unittests.js and 2 other locations - About 4 hrs to fix
    src/extensions/default/HTMLCodeHints/unittests.js on lines 522..529
    src/extensions/default/HTMLCodeHints/unittests.js on lines 544..551

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

    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 valueless attribute before the existing attribute that starts at cursor", function () {
                    testDocument.replaceRange("  <input id='foo'>\n", { line: 9, ch: 0 });  // insert new line
    
                    testEditor.setCursorPos({ line: 9, ch: 9 });    // cursor after between "i" and "d"
                    selectHint(HTMLCodeHints.attrHintProvider, "checked");
    Severity: Major
    Found in src/extensions/default/HTMLCodeHints/unittests.js and 2 other locations - About 4 hrs to fix
    src/extensions/default/HTMLCodeHints/unittests.js on lines 522..529
    src/extensions/default/HTMLCodeHints/unittests.js on lines 553..560

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

    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 NOT insert =\"\" after valueless attribute", function () {
                    testDocument.replaceRange("  <input \n", { line: 9, ch: 0 });  // insert new line
    
                    testEditor.setCursorPos({ line: 9, ch: 9 });    // cursor after trailing space
                    selectHint(HTMLCodeHints.attrHintProvider, "checked");
    Severity: Major
    Found in src/extensions/default/HTMLCodeHints/unittests.js and 2 other locations - About 4 hrs to fix
    src/extensions/default/HTMLCodeHints/unittests.js on lines 544..551
    src/extensions/default/HTMLCodeHints/unittests.js on lines 553..560

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

    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 the unquoted attribute value with the selected attribute value in quotes", function () {
                    // Insert an unquoted attribute between <div and id on line 5.
                    testDocument.replaceRange("dir=ltr ", { line: 5, ch: 6 });
                    testEditor.setCursorPos({ line: 5, ch: 10 });
                    // Select "rtl" to replace "ltr"
    Severity: Major
    Found in src/extensions/default/HTMLCodeHints/unittests.js and 3 other locations - About 4 hrs to fix
    src/extensions/default/HTMLCodeHints/unittests.js on lines 656..663
    src/extensions/default/HTMLCodeHints/unittests.js on lines 665..672
    src/extensions/default/HTMLCodeHints/unittests.js on lines 674..681

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

    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 insert a quoted attribute value before an existing id attribute", function () {
                    // Insert an unquoted attribute between <div and id on line 5.
                    testDocument.replaceRange("dir= ", { line: 5, ch: 6 });
                    testEditor.setCursorPos({ line: 5, ch: 10 }); // Set cursor between = and the space
                    selectHint(HTMLCodeHints.attrHintProvider, "rtl");
    Severity: Major
    Found in src/extensions/default/HTMLCodeHints/unittests.js and 3 other locations - About 4 hrs to fix
    src/extensions/default/HTMLCodeHints/unittests.js on lines 636..644
    src/extensions/default/HTMLCodeHints/unittests.js on lines 656..663
    src/extensions/default/HTMLCodeHints/unittests.js on lines 674..681

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

    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 insert a quoted attribute value before an existing unquoted attribute value with preceding space character", function () {
                    // Insert an unquoted attribute between <div and id on line 5.
                    testDocument.replaceRange("dir= ltr ", { line: 5, ch: 6 });
                    testEditor.setCursorPos({ line: 5, ch: 10 }); // Set cursor between = and the space
                    selectHint(HTMLCodeHints.attrHintProvider, "rtl");
    Severity: Major
    Found in src/extensions/default/HTMLCodeHints/unittests.js and 3 other locations - About 4 hrs to fix
    src/extensions/default/HTMLCodeHints/unittests.js on lines 636..644
    src/extensions/default/HTMLCodeHints/unittests.js on lines 665..672
    src/extensions/default/HTMLCodeHints/unittests.js on lines 674..681

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

    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 insert a quoted attribute value right before the closing > of the tag", function () {
                    // Insert an unquoted attribute between <p and > on line 7.
                    testDocument.replaceRange(" dir=", { line: 7, ch: 4 });
                    testEditor.setCursorPos({ line: 7, ch: 9 }); // Set cursor between = and >
                    selectHint(HTMLCodeHints.attrHintProvider, "rtl");
    Severity: Major
    Found in src/extensions/default/HTMLCodeHints/unittests.js and 3 other locations - About 4 hrs to fix
    src/extensions/default/HTMLCodeHints/unittests.js on lines 636..644
    src/extensions/default/HTMLCodeHints/unittests.js on lines 656..663
    src/extensions/default/HTMLCodeHints/unittests.js on lines 665..672

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

    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 replace the partially typed attribute value with the selected attribute value", function () {
                    testDocument.replaceRange("dir=lt", { line: 9, ch: 7 });  // insert dir="lt after <div tag
                    testEditor.setCursorPos({ line: 9, ch: 13 });
                    selectHint(HTMLCodeHints.attrHintProvider, "ltr");
                    expect(testDocument.getLine(9)).toBe("  <div dir=ltr");
    Severity: Major
    Found in src/extensions/default/HTMLCodeHints/unittests.js and 5 other locations - About 4 hrs to fix
    src/extensions/default/HTMLCodeHints/unittests.js on lines 562..568
    src/extensions/default/HTMLCodeHints/unittests.js on lines 570..576
    src/extensions/default/HTMLCodeHints/unittests.js on lines 578..584
    src/extensions/default/HTMLCodeHints/unittests.js on lines 586..592
    src/extensions/default/HTMLCodeHints/unittests.js on lines 594..600

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

    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 replace the partially typed attribute value with the selected attribute value", function () {
                    testDocument.replaceRange("dir=\"lt", { line: 9, ch: 7 });  // insert dir="lt after <div tag
                    testEditor.setCursorPos({ line: 9, ch: 14 });
                    selectHint(HTMLCodeHints.attrHintProvider, "ltr");
                    expect(testDocument.getLine(9)).toBe("  <div dir=\"ltr\"");
    Severity: Major
    Found in src/extensions/default/HTMLCodeHints/unittests.js and 5 other locations - About 4 hrs to fix
    src/extensions/default/HTMLCodeHints/unittests.js on lines 562..568
    src/extensions/default/HTMLCodeHints/unittests.js on lines 570..576
    src/extensions/default/HTMLCodeHints/unittests.js on lines 578..584
    src/extensions/default/HTMLCodeHints/unittests.js on lines 586..592
    src/extensions/default/HTMLCodeHints/unittests.js on lines 602..608

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

    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 insert the selected attribute value wrapped in double quotes", function () {
                    testDocument.replaceRange("dir=", { line: 9, ch: 7 });  // insert dir= after <div tag
                    testEditor.setCursorPos({ line: 9, ch: 11 });
                    selectHint(HTMLCodeHints.attrHintProvider, "rtl");
                    expect(testDocument.getLine(9)).toBe("  <div dir=\"rtl\"");
    Severity: Major
    Found in src/extensions/default/HTMLCodeHints/unittests.js and 5 other locations - About 4 hrs to fix
    src/extensions/default/HTMLCodeHints/unittests.js on lines 562..568
    src/extensions/default/HTMLCodeHints/unittests.js on lines 570..576
    src/extensions/default/HTMLCodeHints/unittests.js on lines 578..584
    src/extensions/default/HTMLCodeHints/unittests.js on lines 594..600
    src/extensions/default/HTMLCodeHints/unittests.js on lines 602..608

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

    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 insert the selected attribute value with the closing (double) quote", function () {
                    testDocument.replaceRange("dir=\"", { line: 9, ch: 7 });  // insert dir=" after <div tag
                    testEditor.setCursorPos({ line: 9, ch: 12 });
                    selectHint(HTMLCodeHints.attrHintProvider, "rtl");
                    expect(testDocument.getLine(9)).toBe("  <div dir=\"rtl\"");
    Severity: Major
    Found in src/extensions/default/HTMLCodeHints/unittests.js and 5 other locations - About 4 hrs to fix
    src/extensions/default/HTMLCodeHints/unittests.js on lines 562..568
    src/extensions/default/HTMLCodeHints/unittests.js on lines 578..584
    src/extensions/default/HTMLCodeHints/unittests.js on lines 586..592
    src/extensions/default/HTMLCodeHints/unittests.js on lines 594..600
    src/extensions/default/HTMLCodeHints/unittests.js on lines 602..608

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

    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 insert the selected attribute value inside the existing quotes", function () {
                    testDocument.replaceRange("dir=\"\"", { line: 9, ch: 7 });  // insert dir="" after <div tag
                    testEditor.setCursorPos({ line: 9, ch: 12 });
                    selectHint(HTMLCodeHints.attrHintProvider, "rtl");
                    expect(testDocument.getLine(9)).toBe("  <div dir=\"rtl\"");
    Severity: Major
    Found in src/extensions/default/HTMLCodeHints/unittests.js and 5 other locations - About 4 hrs to fix
    src/extensions/default/HTMLCodeHints/unittests.js on lines 562..568
    src/extensions/default/HTMLCodeHints/unittests.js on lines 570..576
    src/extensions/default/HTMLCodeHints/unittests.js on lines 586..592
    src/extensions/default/HTMLCodeHints/unittests.js on lines 594..600
    src/extensions/default/HTMLCodeHints/unittests.js on lines 602..608

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

    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 insert the selected attribute value with the closing (single) quote", function () {
                    testDocument.replaceRange("dir='", { line: 9, ch: 7 });  // insert dir=' after <div tag
                    testEditor.setCursorPos({ line: 9, ch: 12 });
                    selectHint(HTMLCodeHints.attrHintProvider, "rtl");
                    expect(testDocument.getLine(9)).toBe("  <div dir='rtl'");
    Severity: Major
    Found in src/extensions/default/HTMLCodeHints/unittests.js and 5 other locations - About 4 hrs to fix
    src/extensions/default/HTMLCodeHints/unittests.js on lines 570..576
    src/extensions/default/HTMLCodeHints/unittests.js on lines 578..584
    src/extensions/default/HTMLCodeHints/unittests.js on lines 586..592
    src/extensions/default/HTMLCodeHints/unittests.js on lines 594..600
    src/extensions/default/HTMLCodeHints/unittests.js on lines 602..608

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

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

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

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

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

    Refactorings

    Further Reading

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

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

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 112.

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

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

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

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

    Refactorings

    Further Reading

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

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

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 112.

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

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

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

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

    Refactorings

    Further Reading

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

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

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 112.

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

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

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

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

    Refactorings

    Further Reading

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

                it("should insert a new attribute before the existing one that starts at cursor", function () {  // (bug #1312)
                    testEditor.setCursorPos({ line: 5, ch: 6 });    // cursor between space and start of existing attribute name ("id")
                    selectHint(HTMLCodeHints.attrHintProvider, "class");
                    expect(testDocument.getLine(5)).toBe("  <h1 class=\"\"id='foo'>Heading</h1>");
                    expectCursorAt({ line: 5, ch: 13 });            // cursor between two double-quotes
    Severity: Major
    Found in src/extensions/default/HTMLCodeHints/unittests.js and 1 other location - About 3 hrs to fix
    src/extensions/default/HTMLCodeHints/unittests.js on lines 537..542

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

    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 change nothing when cursor at end", function () {  // (bug #1314)
                    testEditor.setCursorPos({ line: 5, ch: 8 });    // cursor between end of existing attribute name ("id") and =
                    selectHint(HTMLCodeHints.attrHintProvider, "id");
                    expect(testDocument.getLine(5)).toBe("  <h1 id='foo'>Heading</h1>");
                    expectCursorAt({ line: 5, ch: 8 });            // cursor stays at end of attr name
    Severity: Major
    Found in src/extensions/default/HTMLCodeHints/unittests.js and 1 other location - About 3 hrs to fix
    src/extensions/default/HTMLCodeHints/unittests.js on lines 531..536

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

    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 list hints between prev attribute value and next attribute name (space on both sides of cursor)", function () {
                    testDocument.replaceRange(" ", { line: 8, ch: 14 });  // insert a space: "'aaa' class" -> "'aaa'  class"
    
                    testEditor.setCursorPos({ line: 8, ch: 15 });   // cursor between two spaces, which are between end of attribute value ("p") and start of attribute name
                    var hintList = expectHints(HTMLCodeHints.attrHintProvider);
    Severity: Major
    Found in src/extensions/default/HTMLCodeHints/unittests.js and 1 other location - About 2 hrs to fix
    src/extensions/default/HTMLCodeHints/unittests.js on lines 243..249

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

    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 list hints between tag name and attribute name (space on both sides of cursor)", function () {
                    testDocument.replaceRange(" ", { line: 5, ch: 5 });  // insert a space: "<h1 id" -> "<h1  id"
    
                    testEditor.setCursorPos({ line: 5, ch: 6 });   // cursor between two spaces, which are between end of tag name ("p") and start of attribute name
                    var hintList = expectHints(HTMLCodeHints.attrHintProvider);
    Severity: Major
    Found in src/extensions/default/HTMLCodeHints/unittests.js and 1 other location - About 2 hrs to fix
    src/extensions/default/HTMLCodeHints/unittests.js on lines 250..256

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

    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 list hints to left of tag", function () {
                    testEditor.setCursorPos({ line: 4, ch: 0 });    // tag starting at column zero
                    expectNoHints(HTMLCodeHints.attrHintProvider);
    
                    testEditor.setCursorPos({ line: 5, ch: 2 });    // tag with whitespace indent after it
    Severity: Major
    Found in src/extensions/default/HTMLCodeHints/unittests.js and 3 other locations - About 2 hrs to fix
    src/extensions/default/HTMLCodeHints/unittests.js on lines 206..211
    src/extensions/default/HTMLCodeHints/unittests.js on lines 265..271
    src/extensions/default/HTMLCodeHints/unittests.js on lines 344..350

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

    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 list hints on incomplete tag, at end of tag name", function () {
                    testEditor.setCursorPos({ line: 9, ch: 5 });    // end of tag name
                    expectNoHints(HTMLCodeHints.attrHintProvider);
    
                    testEditor.setCursorPos({ line: 9, ch: 6 });    // within tag name
    Severity: Major
    Found in src/extensions/default/HTMLCodeHints/unittests.js and 3 other locations - About 2 hrs to fix
    src/extensions/default/HTMLCodeHints/unittests.js on lines 206..211
    src/extensions/default/HTMLCodeHints/unittests.js on lines 258..264
    src/extensions/default/HTMLCodeHints/unittests.js on lines 265..271

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

    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 list hints to right of '=' sign with whitespace on id attr", function () {
                    testEditor.setCursorPos({ line: 6, ch: 11 });   // cursor between = and space
                    expectNoHints(HTMLCodeHints.attrHintProvider);
                    testEditor.setCursorPos({ line: 6, ch: 12 });   // cursor between space and '
                    expectNoHints(HTMLCodeHints.attrHintProvider);
    Severity: Major
    Found in src/extensions/default/HTMLCodeHints/unittests.js and 3 other locations - About 2 hrs to fix
    src/extensions/default/HTMLCodeHints/unittests.js on lines 258..264
    src/extensions/default/HTMLCodeHints/unittests.js on lines 265..271
    src/extensions/default/HTMLCodeHints/unittests.js on lines 344..350

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

    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 list hints within text content or whitespace", function () {
                    testEditor.setCursorPos({ line: 5, ch: 0 });    // whitespace
                    expectNoHints(HTMLCodeHints.attrHintProvider);
    
                    testEditor.setCursorPos({ line: 5, ch: 18 });   // plain text content
    Severity: Major
    Found in src/extensions/default/HTMLCodeHints/unittests.js and 3 other locations - About 2 hrs to fix
    src/extensions/default/HTMLCodeHints/unittests.js on lines 206..211
    src/extensions/default/HTMLCodeHints/unittests.js on lines 258..264
    src/extensions/default/HTMLCodeHints/unittests.js on lines 344..350

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

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

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

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

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

    Refactorings

    Further Reading

    Identical blocks of code found in 3 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/HTMLCodeHints/unittests.js and 2 other locations - About 2 hrs to fix
    src/extensions/default/CSSAtRuleCodeHints/unittests.js on lines 97..101
    src/extensions/default/CSSPseudoSelectorHints/unittests.js on lines 103..107

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 81.

    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 list attribute value hints to the right of a closing single quote", function () {
                    testDocument.replaceRange(" dir='ltr'", { line: 6, ch: 5 });  // insert dir='ltr' between <h3 and id
    
                    testEditor.setCursorPos({ line: 4, ch: 15 });       // set cursor right after dir='ltr'
                    expectNoHints(HTMLCodeHints.attrHintProvider);
    Severity: Major
    Found in src/extensions/default/HTMLCodeHints/unittests.js and 1 other location - About 2 hrs to fix
    src/extensions/default/HTMLCodeHints/unittests.js on lines 399..404

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 77.

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

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

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

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

    Refactorings

    Further Reading

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

                it("should NOT list attribute value hints to the right of a closing double quote", function () {
                    testDocument.replaceRange(" dir=\"ltr\"", { line: 7, ch: 4 });  // insert dir="ltr" between <p and >
    
                    testEditor.setCursorPos({ line: 7, ch: 14 });       // set cursor right after dir="ltr"
                    expectNoHints(HTMLCodeHints.attrHintProvider);
    Severity: Major
    Found in src/extensions/default/HTMLCodeHints/unittests.js and 1 other location - About 2 hrs to fix
    src/extensions/default/HTMLCodeHints/unittests.js on lines 405..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 77.

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

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

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

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

    Refactorings

    Further Reading

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

                it("should NOT list hints between the 'h1' end tag and 'h3' begin tag", function () {  // (bug #1519)
                    // Insert two blank lines with some whitespaces before line 5.
                    testDocument.replaceRange("\n  \n   ", { line: 6, ch: 0 });
    
                    // Set cursor between whitespaces on one of the newly inserted blank lines.
    Severity: Major
    Found in src/extensions/default/HTMLCodeHints/unittests.js and 1 other location - About 2 hrs to fix
    src/extensions/default/HTMLCodeHints/unittests.js on lines 312..319

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

    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 list hints between the 'body' begin tag and 'h1' begin tag", function () {  // (bug #1519)
                    // Insert two blank lines with some whitespaces before line 5.
                    testDocument.replaceRange("\n  \n   ", { line: 5, ch: 0 });
    
                    // Set cursor between whitespaces on one of the newly inserted blank lines.
    Severity: Major
    Found in src/extensions/default/HTMLCodeHints/unittests.js and 1 other location - About 2 hrs to fix
    src/extensions/default/HTMLCodeHints/unittests.js on lines 321..328

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

    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 verifyAttrHints(hintList, expectedFirstHint) {
                expect(hintList.indexOf("div")).toBe(-1);   // make sure tag names aren't sneaking in there
    
                expectedFirstHint = expectedFirstHint || "accesskey";  // assume unfiltered lists always start with "accesskey"
                expect(hintList[0]).toBe(expectedFirstHint);
    Severity: Major
    Found in src/extensions/default/HTMLCodeHints/unittests.js and 1 other location - About 1 hr to fix
    src/extensions/default/HTMLCodeHints/unittests.js on lines 82..87

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 67.

    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 verifyTagHints(hintList, expectedFirstHint) {
                expect(hintList.indexOf("id")).toBe(-1);   // make sure attribute names aren't sneaking in there
    
                expectedFirstHint = expectedFirstHint || "a";  // assume unfiltered lists always start with "a"
                expect(hintList[0]).toBe(expectedFirstHint);
    Severity: Major
    Found in src/extensions/default/HTMLCodeHints/unittests.js and 1 other location - About 1 hr to fix
    src/extensions/default/HTMLCodeHints/unittests.js on lines 90..95

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

    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 list hints at end of existing attribute with whitespace", function () {
                    testEditor.setCursorPos({ line: 6, ch: 8 });        // cursor between end of attr ("d") and space
                    var hintList = expectHints(HTMLCodeHints.attrHintProvider);
                    verifyAttrHints(hintList, "id");  // filtered on "id"
                });
    Severity: Major
    Found in src/extensions/default/HTMLCodeHints/unittests.js and 5 other locations - About 1 hr to fix
    src/extensions/default/CSSCodeHints/unittests.js on lines 167..171
    src/extensions/default/CSSCodeHints/unittests.js on lines 219..223
    src/extensions/default/CSSCodeHints/unittests.js on lines 471..475
    src/extensions/default/CSSCodeHints/unittests.js on lines 523..527
    src/extensions/default/CSSCodeHints/unittests.js on lines 783..787

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

    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 list hints at end of existing attribute", function () {
                    testEditor.setCursorPos({ line: 5, ch: 8 });
                    var hintList = expectHints(HTMLCodeHints.attrHintProvider);
                    verifyAttrHints(hintList, "id");  // filtered on "id"
                });
    Severity: Major
    Found in src/extensions/default/HTMLCodeHints/unittests.js and 5 other locations - About 1 hr to fix
    src/extensions/default/CSSCodeHints/unittests.js on lines 173..178
    src/extensions/default/CSSCodeHints/unittests.js on lines 180..185
    src/extensions/default/CSSCodeHints/unittests.js on lines 477..482
    src/extensions/default/CSSCodeHints/unittests.js on lines 484..489
    src/extensions/default/HTMLCodeHints/unittests.js on lines 169..173

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

    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 list hints within existing attribute", function () {
                    testEditor.setCursorPos({ line: 5, ch: 7 });
                    var hintList = expectHints(HTMLCodeHints.attrHintProvider);
                    verifyAttrHints(hintList, "id");  // filtered on "i"
                });
    Severity: Major
    Found in src/extensions/default/HTMLCodeHints/unittests.js and 5 other locations - About 1 hr to fix
    src/extensions/default/CSSCodeHints/unittests.js on lines 173..178
    src/extensions/default/CSSCodeHints/unittests.js on lines 180..185
    src/extensions/default/CSSCodeHints/unittests.js on lines 477..482
    src/extensions/default/CSSCodeHints/unittests.js on lines 484..489
    src/extensions/default/HTMLCodeHints/unittests.js on lines 174..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 60.

    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 list hints at start of existing attribute", function () {
                    testEditor.setCursorPos({ line: 5, ch: 6 });
                    var hintList = expectHints(HTMLCodeHints.attrHintProvider);
                    verifyAttrHints(hintList);  // expect no filtering (bug #1311)
                });
    Severity: Major
    Found in src/extensions/default/HTMLCodeHints/unittests.js and 1 other location - About 1 hr to fix
    src/extensions/default/HTMLCodeHints/unittests.js on lines 338..343

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

    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 list hints on incomplete tag, after tag name", function () {
                    testEditor.setCursorPos({ line: 9, ch: 7 });
                    var hintList = expectHints(HTMLCodeHints.attrHintProvider);
    
                    verifyAttrHints(hintList);  // expect no filtering
    Severity: Major
    Found in src/extensions/default/HTMLCodeHints/unittests.js and 1 other location - About 1 hr to fix
    src/extensions/default/HTMLCodeHints/unittests.js on lines 164..168

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

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

                it("should NOT list hints to right of attribute value with no separating space", function () {
                    testEditor.setCursorPos({ line: 5, ch: 14 });   // cursor between ' and >
                    expectNoHints(HTMLCodeHints.attrHintProvider);
                });
    Severity: Major
    Found in src/extensions/default/HTMLCodeHints/unittests.js and 14 other locations - About 45 mins to fix
    src/extensions/default/CSSCodeHints/unittests.js on lines 225..228
    src/extensions/default/CSSCodeHints/unittests.js on lines 230..233
    src/extensions/default/CSSCodeHints/unittests.js on lines 235..238
    src/extensions/default/CSSCodeHints/unittests.js on lines 367..370
    src/extensions/default/CSSCodeHints/unittests.js on lines 401..404
    src/extensions/default/CSSCodeHints/unittests.js on lines 406..409
    src/extensions/default/CSSCodeHints/unittests.js on lines 411..414
    src/extensions/default/CSSCodeHints/unittests.js on lines 416..419
    src/extensions/default/CSSCodeHints/unittests.js on lines 439..442
    src/extensions/default/CSSCodeHints/unittests.js on lines 444..447
    src/extensions/default/CSSCodeHints/unittests.js on lines 449..452
    src/extensions/default/CSSCodeHints/unittests.js on lines 529..532
    src/extensions/default/CSSCodeHints/unittests.js on lines 534..537
    src/extensions/default/CSSCodeHints/unittests.js on lines 560..563

    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 list hints within doctype 'tag'", function () {
                    testEditor.setCursorPos({ line: 0, ch: 10 });
                    expectNoHints(HTMLCodeHints.attrHintProvider);
                });
    Severity: Major
    Found in src/extensions/default/HTMLCodeHints/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 351..354
    src/extensions/default/JavaScriptCodeHints/unittests.js on lines 479..482
    src/extensions/default/PrefsCodeHints/unittests.js on lines 486..489
    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 6 locations. Consider refactoring.
    Open

                it("should NOT list hints to left of incomplete tag", function () {
                    testEditor.setCursorPos({ line: 9, ch: 2 });
                    expectNoHints(HTMLCodeHints.attrHintProvider);
                });
    Severity: Major
    Found in src/extensions/default/HTMLCodeHints/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/JavaScriptCodeHints/unittests.js on lines 479..482
    src/extensions/default/PrefsCodeHints/unittests.js on lines 486..489
    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 6 locations. Consider refactoring.
    Open

                it("should NOT list hints to right of '=' sign on id attr", function () {
                    testEditor.setCursorPos({ line: 5, ch: 9 });
                    expectNoHints(HTMLCodeHints.attrHintProvider);
                });
    Severity: Major
    Found in src/extensions/default/HTMLCodeHints/unittests.js and 5 other locations - About 35 mins to fix
    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
    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

    There are no issues that match your filters.

    Category
    Status