adobe/brackets

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

Summary

Maintainability
F
4 days
Test Coverage

File unittests.js has 455 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: Minor
Found in src/extensions/default/StaticServer/unittests.js - About 6 hrs to fix

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

                    runs(function () {
                        nodeConnection.domains.staticServer.getServer(path1, 54321)
                            .done(function (info) {
                                serverInfo1 = info;
                            });
    Severity: Major
    Found in src/extensions/default/StaticServer/unittests.js and 2 other locations - About 2 hrs to fix
    src/extensions/default/StaticServer/unittests.js on lines 186..195
    src/extensions/default/StaticServer/unittests.js on lines 213..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 94.

    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 () {
                        nodeConnection.domains.staticServer.getServer(path1, 0)
                            .done(function (info) {
                                serverInfo1 = info;
                            });
    Severity: Major
    Found in src/extensions/default/StaticServer/unittests.js and 2 other locations - About 2 hrs to fix
    src/extensions/default/StaticServer/unittests.js on lines 131..140
    src/extensions/default/StaticServer/unittests.js on lines 186..195

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

    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 () {
                        nodeConnection.domains.staticServer.getServer(path1, 0)
                            .done(function (info) {
                                serverInfo1 = info;
                            });
    Severity: Major
    Found in src/extensions/default/StaticServer/unittests.js and 2 other locations - About 2 hrs to fix
    src/extensions/default/StaticServer/unittests.js on lines 131..140
    src/extensions/default/StaticServer/unittests.js on lines 213..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 94.

    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(requestId).toBeGreaterThan(-1);
                        expect(location.pathname).toBe("/index.txt");
                        expect(text).toBe("This is a file in folder 1.");
    
    
    Severity: Major
    Found in src/extensions/default/StaticServer/unittests.js and 1 other location - About 2 hrs to fix
    src/extensions/default/StaticServer/unittests.js on lines 393..400

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 87.

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

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

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

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

    Refactorings

    Further Reading

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

                    runs(function () {
                        expect(requestId).toBeGreaterThan(-1);
                        expect(location.pathname).toBe("/index.txt");
                        expect(text).toBe("custom response");
    
    
    Severity: Major
    Found in src/extensions/default/StaticServer/unittests.js and 1 other location - About 2 hrs to fix
    src/extensions/default/StaticServer/unittests.js on lines 346..353

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 87.

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

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

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

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

    Refactorings

    Further Reading

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

                    runs(function () {
                        // it should take longer than the StaticServerDomain timeout to get a response
                        elapsed = new Date();
    
                        // request /index.txt
    Severity: Major
    Found in src/extensions/default/StaticServer/unittests.js and 1 other location - About 1 hr to fix
    src/extensions/default/StaticServer/unittests.js on lines 547..556

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

    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 () {
                        // it should take less than the 500ms timeout to get a response
                        elapsed = new Date();
    
                        // request /index.txt
    Severity: Major
    Found in src/extensions/default/StaticServer/unittests.js and 1 other location - About 1 hr to fix
    src/extensions/default/StaticServer/unittests.js on lines 280..289

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

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

                    runs(function () {
                        nodeConnection.domains.staticServer.getServer(path, 0)
                            .done(function (info) {
                                serverInfo = info;
                            });
    Severity: Major
    Found in src/extensions/default/StaticServer/unittests.js and 8 other locations - About 55 mins to fix
    src/extensions/default/StaticServer/unittests.js on lines 89..94
    src/extensions/default/StaticServer/unittests.js on lines 111..116
    src/extensions/default/StaticServer/unittests.js on lines 158..163
    src/extensions/default/StaticServer/unittests.js on lines 257..262
    src/extensions/default/StaticServer/unittests.js on lines 313..318
    src/extensions/default/StaticServer/unittests.js on lines 410..415
    src/extensions/default/StaticServer/unittests.js on lines 472..477
    src/extensions/default/StaticServer/unittests.js on lines 528..533

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

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

                    runs(function () {
                        nodeConnection.domains.staticServer.getServer(path, 54321)
                            .done(function (info) {
                                serverInfo = info;
                            });
    Severity: Major
    Found in src/extensions/default/StaticServer/unittests.js and 8 other locations - About 55 mins to fix
    src/extensions/default/StaticServer/unittests.js on lines 89..94
    src/extensions/default/StaticServer/unittests.js on lines 158..163
    src/extensions/default/StaticServer/unittests.js on lines 257..262
    src/extensions/default/StaticServer/unittests.js on lines 313..318
    src/extensions/default/StaticServer/unittests.js on lines 363..368
    src/extensions/default/StaticServer/unittests.js on lines 410..415
    src/extensions/default/StaticServer/unittests.js on lines 472..477
    src/extensions/default/StaticServer/unittests.js on lines 528..533

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

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

                    runs(function () {
                        nodeConnection.domains.staticServer.getServer(path, 0)
                            .done(function (info) {
                                serverInfo = info;
                            });
    Severity: Major
    Found in src/extensions/default/StaticServer/unittests.js and 8 other locations - About 55 mins to fix
    src/extensions/default/StaticServer/unittests.js on lines 89..94
    src/extensions/default/StaticServer/unittests.js on lines 111..116
    src/extensions/default/StaticServer/unittests.js on lines 158..163
    src/extensions/default/StaticServer/unittests.js on lines 313..318
    src/extensions/default/StaticServer/unittests.js on lines 363..368
    src/extensions/default/StaticServer/unittests.js on lines 410..415
    src/extensions/default/StaticServer/unittests.js on lines 472..477
    src/extensions/default/StaticServer/unittests.js on lines 528..533

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

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

                    runs(function () {
                        nodeConnection.domains.staticServer.getServer(path, 0)
                            .done(function (info) {
                                serverInfo = info;
                            });
    Severity: Major
    Found in src/extensions/default/StaticServer/unittests.js and 8 other locations - About 55 mins to fix
    src/extensions/default/StaticServer/unittests.js on lines 89..94
    src/extensions/default/StaticServer/unittests.js on lines 111..116
    src/extensions/default/StaticServer/unittests.js on lines 158..163
    src/extensions/default/StaticServer/unittests.js on lines 257..262
    src/extensions/default/StaticServer/unittests.js on lines 313..318
    src/extensions/default/StaticServer/unittests.js on lines 363..368
    src/extensions/default/StaticServer/unittests.js on lines 410..415
    src/extensions/default/StaticServer/unittests.js on lines 528..533

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

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

                    runs(function () {
                        nodeConnection.domains.staticServer.getServer(path, 0)
                            .done(function (info) {
                                serverInfo = info;
                            });
    Severity: Major
    Found in src/extensions/default/StaticServer/unittests.js and 8 other locations - About 55 mins to fix
    src/extensions/default/StaticServer/unittests.js on lines 89..94
    src/extensions/default/StaticServer/unittests.js on lines 111..116
    src/extensions/default/StaticServer/unittests.js on lines 158..163
    src/extensions/default/StaticServer/unittests.js on lines 257..262
    src/extensions/default/StaticServer/unittests.js on lines 313..318
    src/extensions/default/StaticServer/unittests.js on lines 363..368
    src/extensions/default/StaticServer/unittests.js on lines 410..415
    src/extensions/default/StaticServer/unittests.js on lines 472..477

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

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

                    runs(function () {
                        nodeConnection.domains.staticServer.getServer(path, 0)
                            .done(function (info) {
                                serverInfo = info;
                            });
    Severity: Major
    Found in src/extensions/default/StaticServer/unittests.js and 8 other locations - About 55 mins to fix
    src/extensions/default/StaticServer/unittests.js on lines 89..94
    src/extensions/default/StaticServer/unittests.js on lines 111..116
    src/extensions/default/StaticServer/unittests.js on lines 158..163
    src/extensions/default/StaticServer/unittests.js on lines 257..262
    src/extensions/default/StaticServer/unittests.js on lines 363..368
    src/extensions/default/StaticServer/unittests.js on lines 410..415
    src/extensions/default/StaticServer/unittests.js on lines 472..477
    src/extensions/default/StaticServer/unittests.js on lines 528..533

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

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

                    runs(function () {
                        nodeConnection.domains.staticServer.getServer(path, 0)
                            .done(function (info) {
                                serverInfo = info;
                            });
    Severity: Major
    Found in src/extensions/default/StaticServer/unittests.js and 8 other locations - About 55 mins to fix
    src/extensions/default/StaticServer/unittests.js on lines 89..94
    src/extensions/default/StaticServer/unittests.js on lines 111..116
    src/extensions/default/StaticServer/unittests.js on lines 257..262
    src/extensions/default/StaticServer/unittests.js on lines 313..318
    src/extensions/default/StaticServer/unittests.js on lines 363..368
    src/extensions/default/StaticServer/unittests.js on lines 410..415
    src/extensions/default/StaticServer/unittests.js on lines 472..477
    src/extensions/default/StaticServer/unittests.js on lines 528..533

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

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

                    runs(function () {
                        nodeConnection.domains.staticServer.getServer(path, 0)
                            .done(function (info) {
                                serverInfo = info;
                            });
    Severity: Major
    Found in src/extensions/default/StaticServer/unittests.js and 8 other locations - About 55 mins to fix
    src/extensions/default/StaticServer/unittests.js on lines 111..116
    src/extensions/default/StaticServer/unittests.js on lines 158..163
    src/extensions/default/StaticServer/unittests.js on lines 257..262
    src/extensions/default/StaticServer/unittests.js on lines 313..318
    src/extensions/default/StaticServer/unittests.js on lines 363..368
    src/extensions/default/StaticServer/unittests.js on lines 410..415
    src/extensions/default/StaticServer/unittests.js on lines 472..477
    src/extensions/default/StaticServer/unittests.js on lines 528..533

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

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

                    runs(function () {
                        nodeConnection.domains.staticServer.getServer(path, 0)
                            .done(function (info) {
                                serverInfo = info;
                            });
    Severity: Major
    Found in src/extensions/default/StaticServer/unittests.js and 8 other locations - About 55 mins to fix
    src/extensions/default/StaticServer/unittests.js on lines 89..94
    src/extensions/default/StaticServer/unittests.js on lines 111..116
    src/extensions/default/StaticServer/unittests.js on lines 158..163
    src/extensions/default/StaticServer/unittests.js on lines 257..262
    src/extensions/default/StaticServer/unittests.js on lines 313..318
    src/extensions/default/StaticServer/unittests.js on lines 363..368
    src/extensions/default/StaticServer/unittests.js on lines 472..477
    src/extensions/default/StaticServer/unittests.js on lines 528..533

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

    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 () {
                        // write response after the request
                        waitsForDone(nodeConnection.domains.staticServer.writeFilteredResponse(path, "/index.txt", {id: requestId, body: "custom response"}));
                    });
    Severity: Minor
    Found in src/extensions/default/StaticServer/unittests.js and 1 other location - About 45 mins to fix
    src/extensions/default/StaticServer/unittests.js on lines 481..484

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

                    runs(function () {
                        // write response before the request
                        waitsForDone(nodeConnection.domains.staticServer.writeFilteredResponse(path, "/index.txt", {id: requestId, body: "custom response"}));
                    });
    Severity: Minor
    Found in src/extensions/default/StaticServer/unittests.js and 1 other location - About 45 mins to fix
    src/extensions/default/StaticServer/unittests.js on lines 493..496

    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

    There are no issues that match your filters.

    Category
    Status