brisket/brisket

View on GitHub
spec/client/client/ClientRendererSpec.js

Summary

Maintainability
D
2 days
Test Coverage

File ClientRendererSpec.js has 289 lines of code (exceeds 250 allowed). Consider refactoring.
Open

"use strict";

describe("ClientRenderer", function() {
    var ClientRenderer = require("../../../lib/client/ClientRenderer");
    var HasPageLevelData = require("../../../lib/traits/HasPageLevelData");
Severity: Minor
Found in spec/client/client/ClientRendererSpec.js - About 2 hrs to fix

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

                    view = new ViewWithPageLevelData()
                        .withMetatags([
                            new Layout.Metatags({
                                "description": "a",
                                "keywords": "b"
    Severity: Major
    Found in spec/client/client/ClientRendererSpec.js and 1 other location - About 1 hr to fix
    spec/server/ServerRendererSpec.js on lines 406..418

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

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

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

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

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

    Refactorings

    Further Reading

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

                it("renders title from view's page level data", function() {
                    layout.defaultTitle = "Default Title";
                    view = new ViewWithPageLevelData().withTitle("Title");
                    whenClientRenders(2);
    
    
    Severity: Major
    Found in spec/client/client/ClientRendererSpec.js and 1 other location - About 1 hr to fix
    spec/client/client/ClientRendererSpec.js on lines 211..217

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

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

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

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

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

    Refactorings

    Further Reading

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

                it("renders title from view's page level data", function() {
                    layout.defaultTitle = "Default Title";
                    view = new ViewWithPageLevelData().withTitle("Title");
                    whenClientRenders(2);
    
    
    Severity: Major
    Found in spec/client/client/ClientRendererSpec.js and 1 other location - About 1 hr to fix
    spec/client/client/ClientRendererSpec.js on lines 264..270

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

    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("renders title when title tag is on multiple lines", function() {
                    layout.el.innerHTML = "<html><head><title>\n</title></head><body></body></html>";
                    layout.defaultTitle = "Default Title";
                    whenClientRenders(2);
    
    
    Severity: Major
    Found in spec/client/client/ClientRendererSpec.js and 1 other location - About 1 hr to fix
    spec/client/client/ClientRendererSpec.js on lines 292..298

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

                it("renders title when title tag is on multiple lines", function() {
                    layout.el.innerHTML = "<html><head><title class='klass'>\n</title></head><body></body></html>";
                    layout.defaultTitle = "Default Title";
                    whenClientRenders(2);
    
    
    Severity: Major
    Found in spec/client/client/ClientRendererSpec.js and 1 other location - About 1 hr to fix
    spec/client/client/ClientRendererSpec.js on lines 239..245

    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

            describe("and it is NOT the first request", function() {
    
                beforeEach(function() {
                    whenClientRenders(2);
                });
    Severity: Major
    Found in spec/client/client/ClientRendererSpec.js and 2 other locations - About 50 mins to fix
    spec/client/client/ClientRendererSpec.js on lines 122..132
    spec/client/client/ClientRendererSpec.js on lines 164..174

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

    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

            describe("and it is the first request", function() {
    
                beforeEach(function() {
                    whenClientRenders(1);
                });
    Severity: Major
    Found in spec/client/client/ClientRendererSpec.js and 2 other locations - About 50 mins to fix
    spec/client/client/ClientRendererSpec.js on lines 164..174
    spec/client/client/ClientRendererSpec.js on lines 176..186

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

    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

            describe("and it is the first request", function() {
    
                beforeEach(function() {
                    whenClientRenders(1);
                });
    Severity: Major
    Found in spec/client/client/ClientRendererSpec.js and 2 other locations - About 50 mins to fix
    spec/client/client/ClientRendererSpec.js on lines 122..132
    spec/client/client/ClientRendererSpec.js on lines 176..186

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

    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("escapes title for use in html", function() {
                    layout.defaultTitle = "Title \" ' & < > $ $$ $' $` $& $3";
                    whenClientRenders(2);
    
                    expect(document.title).toBe("Title \" ' & < > $ $$ $' $` $& $3");
    Severity: Major
    Found in spec/client/client/ClientRendererSpec.js and 3 other locations - About 45 mins to fix
    spec/client/client/ClientRendererSpec.js on lines 219..224
    spec/client/client/ClientRendererSpec.js on lines 272..277
    spec/client/client/ClientRendererSpec.js on lines 285..290

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 50.

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

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

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

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

    Refactorings

    Further Reading

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

                it("renders layout's defaultTitle when view does NOT have page level data", function() {
                    layout.defaultTitle = "Default Title";
                    whenClientRenders(2);
    
                    expect(document.title).toBe("Default Title");
    Severity: Major
    Found in spec/client/client/ClientRendererSpec.js and 3 other locations - About 45 mins to fix
    spec/client/client/ClientRendererSpec.js on lines 232..237
    spec/client/client/ClientRendererSpec.js on lines 272..277
    spec/client/client/ClientRendererSpec.js on lines 285..290

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 50.

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

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

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

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

    Refactorings

    Further Reading

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

                it("escapes title for use in html", function() {
                    layout.defaultTitle = "Title \" ' & < > $ $$ $' $` $& $3";
                    whenClientRenders(2);
    
                    expect(document.title).toBe("Title \" ' & < > $ $$ $' $` $& $3");
    Severity: Major
    Found in spec/client/client/ClientRendererSpec.js and 3 other locations - About 45 mins to fix
    spec/client/client/ClientRendererSpec.js on lines 219..224
    spec/client/client/ClientRendererSpec.js on lines 232..237
    spec/client/client/ClientRendererSpec.js on lines 272..277

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 50.

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

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

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

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

    Refactorings

    Further Reading

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

                it("renders layout's defaultTitle when view does NOT have page level data", function() {
                    layout.defaultTitle = "Default Title";
                    whenClientRenders(2);
    
                    expect(document.title).toBe("Default Title");
    Severity: Major
    Found in spec/client/client/ClientRendererSpec.js and 3 other locations - About 45 mins to fix
    spec/client/client/ClientRendererSpec.js on lines 219..224
    spec/client/client/ClientRendererSpec.js on lines 232..237
    spec/client/client/ClientRendererSpec.js on lines 285..290

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

        function expectLinkTag(name, content) {
            expect($brisketMetatags.filter("link[rel='" + name + "'][href='" + content + "']")).toExist();
        }
    Severity: Minor
    Found in spec/client/client/ClientRendererSpec.js and 2 other locations - About 40 mins to fix
    spec/client/client/ClientRendererSpec.js on lines 388..390
    spec/client/client/ClientRendererSpec.js on lines 392..394

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

    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

        function expectNormalMetatag(name, content) {
            expect($brisketMetatags.filter("meta[name='" + name + "'][content='" + content + "']")).toExist();
        }
    Severity: Minor
    Found in spec/client/client/ClientRendererSpec.js and 2 other locations - About 40 mins to fix
    spec/client/client/ClientRendererSpec.js on lines 392..394
    spec/client/client/ClientRendererSpec.js on lines 396..398

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

    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

        function expectOpenGraphTag(name, content) {
            expect($brisketMetatags.filter("meta[property='" + name + "'][content='" + content + "']")).toExist();
        }
    Severity: Minor
    Found in spec/client/client/ClientRendererSpec.js and 2 other locations - About 40 mins to fix
    spec/client/client/ClientRendererSpec.js on lines 388..390
    spec/client/client/ClientRendererSpec.js on lines 396..398

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

    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