adobe/brackets

View on GitHub

Showing 3,294 of 3,294 total issues

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

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

        function setupTest(content, languageId) {
            var mock = SpecRunnerUtils.createMockEditor(content, languageId);
            testDocument = mock.doc;
            testEditor = mock.editor;
        }
Severity: Major
Found in src/extensions/default/CSSAtRuleCodeHints/unittests.js and 2 other locations - About 45 mins to fix
src/extensions/default/CSSCodeHints/unittests.js on lines 78..82
src/extensions/default/CSSPseudoSelectorHints/unittests.js on lines 54..58

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

            it("should NOT list prop-name hints after declaration of mediatype", function () {
                testEditor.setCursorPos({ line: 0, ch: 15 });    // after {
                expectNoHints(CSSCodeHints.cssPropHintProvider);
            });
Severity: Major
Found in src/extensions/default/CSSCodeHints/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 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
src/extensions/default/HTMLCodeHints/unittests.js on lines 219..222

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

            it("should NOT list prop-name hints between closed styletag and new opening styletag", function () {
                testEditor.setCursorPos({ line: 8, ch: 0 });    // right before <div
                expectNoHints(CSSCodeHints.cssPropHintProvider);
            });
Severity: Major
Found in src/extensions/default/CSSCodeHints/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 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
src/extensions/default/HTMLCodeHints/unittests.js on lines 219..222

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

Avoid deeply nested control flow statements.
Open

                if (_hasButton(this, DIALOG_BTN_DONTSAVE)) {
                    buttonId = DIALOG_BTN_DONTSAVE;
                }
Severity: Major
Found in src/widgets/Dialogs.js - About 45 mins to fix

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

                it("should NOT list prop-name hints if previous property is not closed properly", function () {
                    testEditor.setCursorPos({ line: 16, ch: 6 });   // cursor directly after color
                    expectNoHints(CSSCodeHints.cssPropHintProvider);
                });
    Severity: Major
    Found in src/extensions/default/CSSCodeHints/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 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
    src/extensions/default/HTMLCodeHints/unittests.js on lines 219..222

    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

    Avoid deeply nested control flow statements.
    Open

                    if (_hasButton(this, DIALOG_BTN_DONTSAVE)) {
                        buttonId = DIALOG_BTN_DONTSAVE;
                    }
    Severity: Major
    Found in src/widgets/Dialogs.js - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                      if (this._highlightIndex === null || this._highlightIndex === 0) {
                          this._highlightIndex = this._displayedResults.length - 1;
                      } else {
                          this._highlightIndex--;
                      }
      Severity: Major
      Found in src/search/QuickSearchField.js - About 45 mins to fix

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

                    it("should NOT list prop-value hints for unknown prop-name", function () {
                        testEditor.setCursorPos({ line: 15, ch: 12 });  // at bordborder:
                        expectNoHints(CSSCodeHints.cssPropHintProvider);
                    });
        Severity: Major
        Found in src/extensions/default/CSSCodeHints/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 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
        src/extensions/default/HTMLCodeHints/unittests.js on lines 219..222

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

                    it("should NOT list hints inside head-tag", function () {
                        testEditor.setCursorPos({ line: 1, ch: 6 });    // between <head> and </head> {
                        expectNoHints(CSSCodeHints.cssPropHintProvider);
                    });
        Severity: Major
        Found in src/extensions/default/CSSCodeHints/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 529..532
        src/extensions/default/CSSCodeHints/unittests.js on lines 534..537
        src/extensions/default/CSSCodeHints/unittests.js on lines 560..563
        src/extensions/default/HTMLCodeHints/unittests.js on lines 219..222

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

                    it("should NOT list prop-name hints after style value context", function () {
                        testEditor.setCursorPos({ line: 10, ch: 20 });    // after "'"
                        expectNoHints(CSSCodeHints.cssPropHintProvider);
                    });
        Severity: Major
        Found in src/extensions/default/CSSCodeHints/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 560..563
        src/extensions/default/HTMLCodeHints/unittests.js on lines 219..222

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

                    it("should NOT list hints after function declaration", function () {
                        testEditor.setCursorPos({ line: 0, ch: 24 });    // after {  after function declaration
                        expectNoHints(CSSCodeHints.cssPropHintProvider);
                    });
        Severity: Major
        Found in src/extensions/default/CSSCodeHints/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/HTMLCodeHints/unittests.js on lines 219..222

        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

        Avoid deeply nested control flow statements.
        Open

                    } else if (e.metaKey && (e.which === KeyEvent.DOM_VK_PERIOD)) {
                        buttonId = DIALOG_BTN_CANCEL;
                    }
        Severity: Major
        Found in src/widgets/Dialogs.js - About 45 mins to fix

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

                      it("should list prop-name hints right after curly bracket", function () {
                          testEditor.setCursorPos({ line: 3, ch: 7 });  // inside body-selector, after {
                          expectHints(CSSCodeHints.cssPropHintProvider);
                      });
          Severity: Major
          Found in src/extensions/default/CSSCodeHints/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 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
          src/extensions/default/HTMLCodeHints/unittests.js on lines 219..222

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

                      it("should list prop-name hints inside single-line styletags at start", function () {
                          testEditor.setCursorPos({ line: 1, ch: 23 });  // inside style, after {
                          expectHints(CSSCodeHints.cssPropHintProvider);
                      });
          Severity: Major
          Found in src/extensions/default/CSSCodeHints/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 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
          src/extensions/default/HTMLCodeHints/unittests.js on lines 219..222

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

                      it("should NOT list hints right before curly bracket", function () {
                          testEditor.setCursorPos({ line: 3, ch: 6 });    // inside body-selector, before {
                          expectNoHints(CSSCodeHints.cssPropHintProvider);
                      });
          Severity: Major
          Found in src/extensions/default/CSSCodeHints/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 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
          src/extensions/default/HTMLCodeHints/unittests.js on lines 219..222

          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

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

                  if (this.selectedIndex !== -1) {
                      $(items[this.selectedIndex]).find("a").removeClass("highlight");
                  }
          Severity: Minor
          Found in src/editor/CodeHintList.js and 1 other location - About 45 mins to fix
          src/widgets/InlineMenu.js on lines 124..126

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

                          it("should increase hue by 3.6 on up arrow", function () {
                              testKey({
                                  item:      "$hueBase",
                                  key:       KeyEvent.DOM_VK_UP,
                                  param:     "h",
          Severity: Major
          Found in src/extensions/default/InlineColorEditor/unittests.js and 3 other locations - About 45 mins to fix
          src/extensions/default/InlineColorEditor/unittests.js on lines 868..876
          src/extensions/default/InlineColorEditor/unittests.js on lines 948..956
          src/extensions/default/InlineColorEditor/unittests.js on lines 1108..1116

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

                          left = (parseInt(that.element.css('left'), 10) + (that.position.left - that.originalPosition.left)) || null,
          src/extensions/default/JavaScriptQuickEdit/unittest-files/jquery-ui/ui/jquery.ui.resizable.js on lines 326..326
          src/extensions/default/JavaScriptQuickEdit/unittest-files/jquery-ui/ui/jquery.ui.resizable.js on lines 615..615
          src/extensions/default/JavaScriptQuickEdit/unittest-files/jquery-ui/ui/jquery.ui.resizable.js on lines 616..616

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

                          top = (parseInt(that.element.css('top'), 10) + (that.position.top - that.originalPosition.top)) || null;
          src/extensions/default/JavaScriptQuickEdit/unittest-files/jquery-ui/ui/jquery.ui.resizable.js on lines 325..325
          src/extensions/default/JavaScriptQuickEdit/unittest-files/jquery-ui/ui/jquery.ui.resizable.js on lines 615..615
          src/extensions/default/JavaScriptQuickEdit/unittest-files/jquery-ui/ui/jquery.ui.resizable.js on lines 616..616

          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

          Severity
          Category
          Status
          Source
          Language