brisket/brisket

View on GitHub
spec/server/ServerResponseWorkflowSpec.js

Summary

Maintainability
C
1 day
Test Coverage

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

        it("sends back the successful content", function(done) {
            whenAppResponseReturnsSuccessfully(function() {
                expect(mockExpressResponse.status).toHaveBeenCalledWith(200);
                expect(mockExpressResponse.send).toHaveBeenCalledWith("successful content");
                done();
Severity: Major
Found in spec/server/ServerResponseWorkflowSpec.js and 1 other location - About 1 hr to fix
spec/server/ServerResponseWorkflowSpec.js on lines 62..68

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

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("sends back the successful content", function(done) {
            whenAppResponseReturnsSuccessfully(function() {
                expect(mockExpressResponse.status).toHaveBeenCalledWith(204);
                expect(mockExpressResponse.send).toHaveBeenCalledWith("successful content");
                done();
Severity: Major
Found in spec/server/ServerResponseWorkflowSpec.js and 1 other location - About 1 hr to fix
spec/server/ServerResponseWorkflowSpec.js on lines 34..40

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

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

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

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

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

Refactorings

Further Reading

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

        it("redirects to application paths WITH appRoot set", function(done) {
            givenAppRootSet();
            givenRedirectWithApplicationPath();

            whenAppResponseReturnsSuccessfully(function() {
Severity: Major
Found in spec/server/ServerResponseWorkflowSpec.js and 2 other locations - About 1 hr to fix
spec/server/ServerResponseWorkflowSpec.js on lines 111..119
spec/server/ServerResponseWorkflowSpec.js on lines 130..138

Duplicated Code

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

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

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

Tuning

This issue has a mass of 64.

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

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

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

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

Refactorings

Further Reading

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

        it("redirects to absolute paths WITH appRoot set", function(done) {
            givenAppRootSet();
            givenRedirectWithAbsolutePath();

            whenAppResponseReturnsSuccessfully(function() {
Severity: Major
Found in spec/server/ServerResponseWorkflowSpec.js and 2 other locations - About 1 hr to fix
spec/server/ServerResponseWorkflowSpec.js on lines 92..100
spec/server/ServerResponseWorkflowSpec.js on lines 130..138

Duplicated Code

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

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

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

Tuning

This issue has a mass of 64.

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

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

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

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

Refactorings

Further Reading

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

        it("redirects to fully qualified urls WITH appRoot set", function(done) {
            givenAppRootSet();
            givenRedirectWithFullyQualifiedUrl();

            whenAppResponseReturnsSuccessfully(function() {
Severity: Major
Found in spec/server/ServerResponseWorkflowSpec.js and 2 other locations - About 1 hr to fix
spec/server/ServerResponseWorkflowSpec.js on lines 92..100
spec/server/ServerResponseWorkflowSpec.js on lines 111..119

Duplicated Code

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

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

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

Tuning

This issue has a mass of 64.

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

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

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

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

Refactorings

Further Reading

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

        it("redirects to requested destination with custom status", function(done) {
            givenRedirectWithCustomStatus();

            whenAppResponseReturnsSuccessfully(function() {
                expect(mockExpressResponse.redirect).toHaveBeenCalledWith(301, "/redirect/with/status");
Severity: Major
Found in spec/server/ServerResponseWorkflowSpec.js and 3 other locations - About 1 hr to fix
spec/server/ServerResponseWorkflowSpec.js on lines 83..90
spec/server/ServerResponseWorkflowSpec.js on lines 102..109
spec/server/ServerResponseWorkflowSpec.js on lines 121..128

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("redirects to absolute paths WITHOUT appRoot set", function(done) {
            givenRedirectWithAbsolutePath();

            whenAppResponseReturnsSuccessfully(function() {
                expect(mockExpressResponse.redirect).toHaveBeenCalledWith(302, "/somewhere/in/app");
Severity: Major
Found in spec/server/ServerResponseWorkflowSpec.js and 3 other locations - About 1 hr to fix
spec/server/ServerResponseWorkflowSpec.js on lines 83..90
spec/server/ServerResponseWorkflowSpec.js on lines 121..128
spec/server/ServerResponseWorkflowSpec.js on lines 144..151

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("redirects to application paths WITHOUT appRoot set", function(done) {
            givenRedirectWithApplicationPath();

            whenAppResponseReturnsSuccessfully(function() {
                expect(mockExpressResponse.redirect).toHaveBeenCalledWith(302, "/somewhere/in/app");
Severity: Major
Found in spec/server/ServerResponseWorkflowSpec.js and 3 other locations - About 1 hr to fix
spec/server/ServerResponseWorkflowSpec.js on lines 102..109
spec/server/ServerResponseWorkflowSpec.js on lines 121..128
spec/server/ServerResponseWorkflowSpec.js on lines 144..151

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("redirects to fully qualified urls WITHOUT appRoot set", function(done) {
            givenRedirectWithFullyQualifiedUrl();

            whenAppResponseReturnsSuccessfully(function() {
                expect(mockExpressResponse.redirect).toHaveBeenCalledWith(302, "http://www.fullyqualified.com");
Severity: Major
Found in spec/server/ServerResponseWorkflowSpec.js and 3 other locations - About 1 hr to fix
spec/server/ServerResponseWorkflowSpec.js on lines 83..90
spec/server/ServerResponseWorkflowSpec.js on lines 102..109
spec/server/ServerResponseWorkflowSpec.js on lines 144..151

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

There are no issues that match your filters.

Category
Status