adobe/brackets

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

Summary

Maintainability
F
3 wks
Test Coverage

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

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

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

                it("should insert folder and replace file in HTML", function () {
                    var pos1    = { line: 23, ch: 11 },
                        pos2    = { line: 23, ch: 21 },
                        pos3    = { line: 23, ch: 31 },
                        pos4    = { line: 23, ch: 32 };
    Severity: Major
    Found in src/extensions/default/UrlCodeHints/unittests.js and 1 other location - About 2 days to fix
    src/extensions/default/UrlCodeHints/unittests.js on lines 705..752

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

    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 folder and replace file in CSS", function () {
                    var pos1    = { line: 10, ch: 24 },
                        pos2    = { line: 10, ch: 34 },
                        pos3    = { line: 10, ch: 43 },
                        pos4    = { line: 10, ch: 45 };
    Severity: Major
    Found in src/extensions/default/UrlCodeHints/unittests.js and 1 other location - About 2 days to fix
    src/extensions/default/UrlCodeHints/unittests.js on lines 580..627

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

    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 show & insert case insensitive hints in CSS", function () {
                    var pos1    = { line: 6, ch: 24 },
                        pos2    = { line: 6, ch: 25 },
                        pos3    = { line: 6, ch: 33 };
    
    
    Severity: Major
    Found in src/extensions/default/UrlCodeHints/unittests.js and 1 other location - About 1 day to fix
    src/extensions/default/UrlCodeHints/unittests.js on lines 852..876

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

    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 show & insert case insensitive hints in HTML", function () {
                    var pos1    = { line: 18, ch: 12 },
                        pos2    = { line: 18, ch: 13 },
                        pos3    = { line: 18, ch: 21 };
    
    
    Severity: Major
    Found in src/extensions/default/UrlCodeHints/unittests.js and 1 other location - About 1 day to fix
    src/extensions/default/UrlCodeHints/unittests.js on lines 878..902

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

    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 filtered file in CSS", function () {
                    var pos1    = { line: 10, ch: 24 },
                        pos2    = { line: 10, ch: 27 },
                        pos3    = { line: 10, ch: 34 };
    
    
    Severity: Major
    Found in src/extensions/default/UrlCodeHints/unittests.js and 3 other locations - About 1 day to fix
    src/extensions/default/UrlCodeHints/unittests.js on lines 657..679
    src/extensions/default/UrlCodeHints/unittests.js on lines 681..703
    src/extensions/default/UrlCodeHints/unittests.js on lines 754..776

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

    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 filtered folder in HTML", function () {
                    var pos1    = { line: 23, ch: 11 },
                        pos2    = { line: 23, ch: 14 },
                        pos3    = { line: 23, ch: 31 };
    
    
    Severity: Major
    Found in src/extensions/default/UrlCodeHints/unittests.js and 3 other locations - About 1 day to fix
    src/extensions/default/UrlCodeHints/unittests.js on lines 681..703
    src/extensions/default/UrlCodeHints/unittests.js on lines 754..776
    src/extensions/default/UrlCodeHints/unittests.js on lines 778..800

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

    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 filtered file in HTML", function () {
                    var pos1    = { line: 23, ch: 11 },
                        pos2    = { line: 23, ch: 14 },
                        pos3    = { line: 23, ch: 21 };
    
    
    Severity: Major
    Found in src/extensions/default/UrlCodeHints/unittests.js and 3 other locations - About 1 day to fix
    src/extensions/default/UrlCodeHints/unittests.js on lines 657..679
    src/extensions/default/UrlCodeHints/unittests.js on lines 754..776
    src/extensions/default/UrlCodeHints/unittests.js on lines 778..800

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

    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 filtered folder in CSS", function () {
                    var pos1    = { line: 10, ch: 24 },
                        pos2    = { line: 10, ch: 27 },
                        pos3    = { line: 10, ch: 43 };
    
    
    Severity: Major
    Found in src/extensions/default/UrlCodeHints/unittests.js and 3 other locations - About 1 day to fix
    src/extensions/default/UrlCodeHints/unittests.js on lines 657..679
    src/extensions/default/UrlCodeHints/unittests.js on lines 681..703
    src/extensions/default/UrlCodeHints/unittests.js on lines 778..800

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

    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 collapse consecutive path separators when inserting folder in CSS", function () {
                    var pos1    = { line: 9, ch: 15 },
                        pos2    = { line: 9, ch: 26 };
    
                    runs(function () {
    Severity: Major
    Found in src/extensions/default/UrlCodeHints/unittests.js and 1 other location - About 1 day to fix
    src/extensions/default/UrlCodeHints/unittests.js on lines 802..825

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

    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 collapse consecutive path separators when inserting folder in HTML", function () {
                    var pos1    = { line: 22, ch: 11 },
                        pos2    = { line: 22, ch: 22 };
    
                    runs(function () {
    Severity: Major
    Found in src/extensions/default/UrlCodeHints/unittests.js and 1 other location - About 1 day to fix
    src/extensions/default/UrlCodeHints/unittests.js on lines 827..850

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

    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

                    runs(function () {
                        expect(hintsObj).toBeTruthy();
                        expect(hintsObj.hints).toBeTruthy();
                        expect(hintsObj.hints.length).toBe(subfolderDirHints.length);
    
    
    Severity: Major
    Found in src/extensions/default/UrlCodeHints/unittests.js and 1 other location - About 1 day to fix
    src/extensions/default/UrlCodeHints/unittests.js on lines 561..577

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

    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

                    runs(function () {
                        expect(hintsObj).toBeTruthy();
                        expect(hintsObj.hints).toBeTruthy();
                        expect(hintsObj.hints.length).toBe(subfolderDirHints.length);
    
    
    Severity: Major
    Found in src/extensions/default/UrlCodeHints/unittests.js and 1 other location - About 1 day to fix
    src/extensions/default/UrlCodeHints/unittests.js on lines 506..522

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

    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

                    runs(function () {
                        expect(hintsObj).toBeTruthy();
                        expect(hintsObj.hints).toBeTruthy();
                        expect(hintsObj.hints.length).toBe(1);
                        expect(hintsObj.hints[0]).toBe("subfolder/chevron.png");
    Severity: Major
    Found in src/extensions/default/UrlCodeHints/unittests.js and 1 other location - About 7 hrs to fix
    src/extensions/default/UrlCodeHints/unittests.js on lines 456..470

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

    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

                    runs(function () {
                        expect(hintsObj).toBeTruthy();
                        expect(hintsObj.hints).toBeTruthy();
                        expect(hintsObj.hints.length).toBe(2);
                        expect(hintsObj.hints[1]).toBe("test.html");
    Severity: Major
    Found in src/extensions/default/UrlCodeHints/unittests.js and 1 other location - About 7 hrs to fix
    src/extensions/default/UrlCodeHints/unittests.js on lines 640..654

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

    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 hint for background-image: url() in CSS", function () {
                    runs(function () {
                        setupTests(testCssPath);
                    });
    
    
    Severity: Major
    Found in src/extensions/default/UrlCodeHints/unittests.js and 1 other location - About 3 hrs to fix
    src/extensions/default/UrlCodeHints/unittests.js on lines 311..325

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 108.

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

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

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

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

    Refactorings

    Further Reading

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

                it("should hint for background-image: url() in SCSS", function () {
                    runs(function () {
                        setupTests(testScssPath);
                    });
    
    
    Severity: Major
    Found in src/extensions/default/UrlCodeHints/unittests.js and 1 other location - About 3 hrs to fix
    src/extensions/default/UrlCodeHints/unittests.js on lines 295..309

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 108.

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

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

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

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

    Refactorings

    Further Reading

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

                it("should hint for @import url()", function () {
                    runs(function () {
                        testEditor.setCursorPos({ line: 4, ch: 12 });
                        hintsObj = null;
                        expectAsyncHints(UrlCodeHints.hintProvider);
    Severity: Major
    Found in src/extensions/default/UrlCodeHints/unittests.js and 5 other locations - About 2 hrs to fix
    src/extensions/default/UrlCodeHints/unittests.js on lines 164..174
    src/extensions/default/UrlCodeHints/unittests.js on lines 176..186
    src/extensions/default/UrlCodeHints/unittests.js on lines 238..248
    src/extensions/default/UrlCodeHints/unittests.js on lines 250..260
    src/extensions/default/UrlCodeHints/unittests.js on lines 262..272

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

    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 hint for poster attribute", function () {
                    runs(function () {
                        testEditor.setCursorPos({ line: 24, ch: 17 });
                        hintsObj = null;
                        expectAsyncHints(UrlCodeHints.hintProvider);
    Severity: Major
    Found in src/extensions/default/UrlCodeHints/unittests.js and 5 other locations - About 2 hrs to fix
    src/extensions/default/UrlCodeHints/unittests.js on lines 164..174
    src/extensions/default/UrlCodeHints/unittests.js on lines 226..236
    src/extensions/default/UrlCodeHints/unittests.js on lines 238..248
    src/extensions/default/UrlCodeHints/unittests.js on lines 250..260
    src/extensions/default/UrlCodeHints/unittests.js on lines 262..272

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

    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 hint for border-image: url('')", function () {
                    runs(function () {
                        testEditor.setCursorPos({ line: 7, ch: 21 });
                        hintsObj = null;
                        expectAsyncHints(UrlCodeHints.hintProvider);
    Severity: Major
    Found in src/extensions/default/UrlCodeHints/unittests.js and 5 other locations - About 2 hrs to fix
    src/extensions/default/UrlCodeHints/unittests.js on lines 164..174
    src/extensions/default/UrlCodeHints/unittests.js on lines 176..186
    src/extensions/default/UrlCodeHints/unittests.js on lines 226..236
    src/extensions/default/UrlCodeHints/unittests.js on lines 238..248
    src/extensions/default/UrlCodeHints/unittests.js on lines 262..272

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

    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 hint for src attribute", function () {
                    runs(function () {
                        testEditor.setCursorPos({ line: 15, ch: 13 });
                        hintsObj = null;
                        expectAsyncHints(UrlCodeHints.hintProvider);
    Severity: Major
    Found in src/extensions/default/UrlCodeHints/unittests.js and 5 other locations - About 2 hrs to fix
    src/extensions/default/UrlCodeHints/unittests.js on lines 176..186
    src/extensions/default/UrlCodeHints/unittests.js on lines 226..236
    src/extensions/default/UrlCodeHints/unittests.js on lines 238..248
    src/extensions/default/UrlCodeHints/unittests.js on lines 250..260
    src/extensions/default/UrlCodeHints/unittests.js on lines 262..272

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

    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 hint for background-image: url()", function () {
                    runs(function () {
                        testEditor.setCursorPos({ line: 6, ch: 24 });
                        hintsObj = null;
                        expectAsyncHints(UrlCodeHints.hintProvider);
    Severity: Major
    Found in src/extensions/default/UrlCodeHints/unittests.js and 5 other locations - About 2 hrs to fix
    src/extensions/default/UrlCodeHints/unittests.js on lines 164..174
    src/extensions/default/UrlCodeHints/unittests.js on lines 176..186
    src/extensions/default/UrlCodeHints/unittests.js on lines 226..236
    src/extensions/default/UrlCodeHints/unittests.js on lines 250..260
    src/extensions/default/UrlCodeHints/unittests.js on lines 262..272

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

    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 hint for list-style-image: url(\"\")", function () {
                    runs(function () {
                        testEditor.setCursorPos({ line: 8, ch: 25 });
                        hintsObj = null;
                        expectAsyncHints(UrlCodeHints.hintProvider);
    Severity: Major
    Found in src/extensions/default/UrlCodeHints/unittests.js and 5 other locations - About 2 hrs to fix
    src/extensions/default/UrlCodeHints/unittests.js on lines 164..174
    src/extensions/default/UrlCodeHints/unittests.js on lines 176..186
    src/extensions/default/UrlCodeHints/unittests.js on lines 226..236
    src/extensions/default/UrlCodeHints/unittests.js on lines 238..248
    src/extensions/default/UrlCodeHints/unittests.js on lines 250..260

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

    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

                    runs(function () {
                        testEditor.setCursorPos(pos1);
                        testDocument.replaceRange('url("', pos1, pos1);
                        testEditor.setCursorPos(pos2);
                        hintsObj = null;
    Severity: Major
    Found in src/extensions/default/UrlCodeHints/unittests.js and 2 other locations - About 1 hr to fix
    src/extensions/default/UrlCodeHints/unittests.js on lines 420..426
    src/extensions/default/UrlCodeHints/unittests.js on lines 448..454

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

    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

                    runs(function () {
                        testEditor.setCursorPos(pos1);
                        testDocument.replaceRange("url(", pos1, pos1);
                        testEditor.setCursorPos(pos2);
                        hintsObj = null;
    Severity: Major
    Found in src/extensions/default/UrlCodeHints/unittests.js and 2 other locations - About 1 hr to fix
    src/extensions/default/UrlCodeHints/unittests.js on lines 448..454
    src/extensions/default/UrlCodeHints/unittests.js on lines 532..538

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 65.

    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

                    runs(function () {
                        testEditor.setCursorPos(pos1);
                        testDocument.replaceRange("url('", pos1, pos1);
                        testEditor.setCursorPos(pos2);
                        hintsObj = null;
    Severity: Major
    Found in src/extensions/default/UrlCodeHints/unittests.js and 2 other locations - About 1 hr to fix
    src/extensions/default/UrlCodeHints/unittests.js on lines 420..426
    src/extensions/default/UrlCodeHints/unittests.js on lines 532..538

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 65.

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

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

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

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

    Refactorings

    Further Reading

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

                it("should not hint for @import outside of url()", function () {
                    runs(function () {
                        testEditor.setCursorPos({ line: 4, ch: 15 });
                        expectNoHints(UrlCodeHints.hintProvider);
                    });
    Severity: Major
    Found in src/extensions/default/UrlCodeHints/unittests.js and 3 other locations - About 1 hr to fix
    src/extensions/default/UrlCodeHints/unittests.js on lines 188..193
    src/extensions/default/UrlCodeHints/unittests.js on lines 195..200
    src/extensions/default/UrlCodeHints/unittests.js on lines 281..286

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 58.

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

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

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

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

    Refactorings

    Further Reading

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

                it("should not hint for type attribute", function () {
                    runs(function () {
                        testEditor.setCursorPos({ line: 15, ch: 21 });
                        expectNoHints(UrlCodeHints.hintProvider);
                    });
    Severity: Major
    Found in src/extensions/default/UrlCodeHints/unittests.js and 3 other locations - About 1 hr to fix
    src/extensions/default/UrlCodeHints/unittests.js on lines 195..200
    src/extensions/default/UrlCodeHints/unittests.js on lines 274..279
    src/extensions/default/UrlCodeHints/unittests.js on lines 281..286

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 58.

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

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

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

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

    Refactorings

    Further Reading

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

                it("should not hint for background-image outside of url()", function () {
                    runs(function () {
                        testEditor.setCursorPos({ line: 11, ch: 20 });
                        expectNoHints(UrlCodeHints.hintProvider);
                    });
    Severity: Major
    Found in src/extensions/default/UrlCodeHints/unittests.js and 3 other locations - About 1 hr to fix
    src/extensions/default/UrlCodeHints/unittests.js on lines 188..193
    src/extensions/default/UrlCodeHints/unittests.js on lines 195..200
    src/extensions/default/UrlCodeHints/unittests.js on lines 274..279

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 58.

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

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

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

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

    Refactorings

    Further Reading

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

                it("should not hint in query part of url", function () {
                    runs(function () {
                        testEditor.setCursorPos({ line: 20, ch: 31 });
                        expectNoHints(UrlCodeHints.hintProvider);
                    });
    Severity: Major
    Found in src/extensions/default/UrlCodeHints/unittests.js and 3 other locations - About 1 hr to fix
    src/extensions/default/UrlCodeHints/unittests.js on lines 188..193
    src/extensions/default/UrlCodeHints/unittests.js on lines 274..279
    src/extensions/default/UrlCodeHints/unittests.js on lines 281..286

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 58.

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

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

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

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

    Refactorings

    Further Reading

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

        var MasterDocumentManager     = brackets.getModule("document/DocumentManager"),
            MasterMainViewManager     = brackets.getModule("view/MainViewManager"),
            FileUtils                 = brackets.getModule("file/FileUtils"),
            SpecRunnerUtils           = brackets.getModule("spec/SpecRunnerUtils"),
            UrlCodeHints              = require("main");
    Severity: Major
    Found in src/extensions/default/UrlCodeHints/unittests.js and 1 other location - About 1 hr to fix
    src/extensions/default/HealthData/HealthDataPopup.js on lines 28..32

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

    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