mike-goodwin/owasp-threat-dragon

View on GitHub
td.tests/serverspec/threatmodelcontroller_spec.js

Summary

Maintainability
F
2 wks
Test Coverage

File threatmodelcontroller_spec.js has 439 lines of code (exceeds 250 allowed). Consider refactoring.
Open

'use strict'

require('jasmine');

describe('threat model controller tests', function () {
Severity: Minor
Found in td.tests/serverspec/threatmodelcontroller_spec.js - About 6 hrs to fix

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

        it('should create the specified model', function () {
    
            var createResponse = 'create';
    
            mockRepository.create = function (modelInfo, accessToken, cb) {
    Severity: Major
    Found in td.tests/serverspec/threatmodelcontroller_spec.js and 1 other location - About 1 day to fix
    td.tests/serverspec/threatmodelcontroller_spec.js on lines 363..379

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

    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 update the specified model', function () {
    
            var updateResponse = 'update';
    
            mockRepository.update = function (modelInfo, accessToken, cb) {
    Severity: Major
    Found in td.tests/serverspec/threatmodelcontroller_spec.js and 1 other location - About 1 day to fix
    td.tests/serverspec/threatmodelcontroller_spec.js on lines 307..323

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

    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 return the specified error when fetching the branches for the specified repo', function () {
    
            var error = new Error('branches error');
            error.statusCode = 400;
    
    
    Severity: Major
    Found in td.tests/serverspec/threatmodelcontroller_spec.js and 5 other locations - About 7 hrs to fix
    td.tests/serverspec/threatmodelcontroller_spec.js on lines 232..249
    td.tests/serverspec/threatmodelcontroller_spec.js on lines 288..305
    td.tests/serverspec/threatmodelcontroller_spec.js on lines 344..361
    td.tests/serverspec/threatmodelcontroller_spec.js on lines 400..417
    td.tests/serverspec/threatmodelcontroller_spec.js on lines 456..473

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

    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 return the specified error when deleting the specified model', function () {
    
            var error = new Error('delete error');
            error.statusCode = 400;
    
    
    Severity: Major
    Found in td.tests/serverspec/threatmodelcontroller_spec.js and 5 other locations - About 7 hrs to fix
    td.tests/serverspec/threatmodelcontroller_spec.js on lines 171..188
    td.tests/serverspec/threatmodelcontroller_spec.js on lines 232..249
    td.tests/serverspec/threatmodelcontroller_spec.js on lines 288..305
    td.tests/serverspec/threatmodelcontroller_spec.js on lines 344..361
    td.tests/serverspec/threatmodelcontroller_spec.js on lines 400..417

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

    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 return the specified error when updating the specified model', function () {
    
            var error = new Error('update error');
            error.statusCode = 400;
    
    
    Severity: Major
    Found in td.tests/serverspec/threatmodelcontroller_spec.js and 5 other locations - About 7 hrs to fix
    td.tests/serverspec/threatmodelcontroller_spec.js on lines 171..188
    td.tests/serverspec/threatmodelcontroller_spec.js on lines 232..249
    td.tests/serverspec/threatmodelcontroller_spec.js on lines 288..305
    td.tests/serverspec/threatmodelcontroller_spec.js on lines 344..361
    td.tests/serverspec/threatmodelcontroller_spec.js on lines 456..473

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

    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 return the specified error when fetching the specified model', function () {
    
            var error = new Error('model error');
            error.statusCode = 400;
    
    
    Severity: Major
    Found in td.tests/serverspec/threatmodelcontroller_spec.js and 5 other locations - About 7 hrs to fix
    td.tests/serverspec/threatmodelcontroller_spec.js on lines 171..188
    td.tests/serverspec/threatmodelcontroller_spec.js on lines 232..249
    td.tests/serverspec/threatmodelcontroller_spec.js on lines 344..361
    td.tests/serverspec/threatmodelcontroller_spec.js on lines 400..417
    td.tests/serverspec/threatmodelcontroller_spec.js on lines 456..473

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

    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 return the specified error when creating the specified model', function () {
    
            var error = new Error('create error');
            error.statusCode = 400 ;
    
    
    Severity: Major
    Found in td.tests/serverspec/threatmodelcontroller_spec.js and 5 other locations - About 7 hrs to fix
    td.tests/serverspec/threatmodelcontroller_spec.js on lines 171..188
    td.tests/serverspec/threatmodelcontroller_spec.js on lines 232..249
    td.tests/serverspec/threatmodelcontroller_spec.js on lines 288..305
    td.tests/serverspec/threatmodelcontroller_spec.js on lines 400..417
    td.tests/serverspec/threatmodelcontroller_spec.js on lines 456..473

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

    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 return the specified error when fetching the models for the specified repo and branch', function () {
    
            var error = new Error('models error');
            error.statusCode = 400;
    
    
    Severity: Major
    Found in td.tests/serverspec/threatmodelcontroller_spec.js and 5 other locations - About 7 hrs to fix
    td.tests/serverspec/threatmodelcontroller_spec.js on lines 171..188
    td.tests/serverspec/threatmodelcontroller_spec.js on lines 288..305
    td.tests/serverspec/threatmodelcontroller_spec.js on lines 344..361
    td.tests/serverspec/threatmodelcontroller_spec.js on lines 400..417
    td.tests/serverspec/threatmodelcontroller_spec.js on lines 456..473

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

    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('should error 500 when creating the specified model', function () {
    
            var error = new Error('create error');
            var data = 'create';
    
    
    Severity: Major
    Found in td.tests/serverspec/threatmodelcontroller_spec.js and 2 other locations - About 7 hrs to fix
    td.tests/serverspec/threatmodelcontroller_spec.js on lines 381..398
    td.tests/serverspec/threatmodelcontroller_spec.js on lines 437..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 175.

    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('should error 500 when updating the specified model', function () {
    
            var error = new Error('update error');
            var data = 'update';
    
    
    Severity: Major
    Found in td.tests/serverspec/threatmodelcontroller_spec.js and 2 other locations - About 7 hrs to fix
    td.tests/serverspec/threatmodelcontroller_spec.js on lines 325..342
    td.tests/serverspec/threatmodelcontroller_spec.js on lines 437..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 175.

    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('should error 500 when deleting the specified model', function () {
    
            var error = new Error('delete error');
            var data = 'delete';
    
    
    Severity: Major
    Found in td.tests/serverspec/threatmodelcontroller_spec.js and 2 other locations - About 7 hrs to fix
    td.tests/serverspec/threatmodelcontroller_spec.js on lines 325..342
    td.tests/serverspec/threatmodelcontroller_spec.js on lines 381..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 175.

    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('should error 500 when fetching the specified model', function () {
    
            var error = new Error('model error');
    
            mockRepository.model = function (modelInfo, accessToken, cb) {
    Severity: Major
    Found in td.tests/serverspec/threatmodelcontroller_spec.js and 2 other locations - About 6 hrs to fix
    td.tests/serverspec/threatmodelcontroller_spec.js on lines 153..169
    td.tests/serverspec/threatmodelcontroller_spec.js on lines 214..230

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

    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('should error 500 when fetching the models for the specified repo and branch', function () {
    
            var error = new Error('models error');
    
            mockRepository.models = function (branchInfo, accessToken, cb) {
    Severity: Major
    Found in td.tests/serverspec/threatmodelcontroller_spec.js and 2 other locations - About 6 hrs to fix
    td.tests/serverspec/threatmodelcontroller_spec.js on lines 153..169
    td.tests/serverspec/threatmodelcontroller_spec.js on lines 270..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 168.

    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('should error 500 when fetching the branches for the specified repo', function () {
    
            var error = new Error('branches error');
    
            mockRepository.branches = function (repoInfo, accessToken, cb) {
    Severity: Major
    Found in td.tests/serverspec/threatmodelcontroller_spec.js and 2 other locations - About 6 hrs to fix
    td.tests/serverspec/threatmodelcontroller_spec.js on lines 214..230
    td.tests/serverspec/threatmodelcontroller_spec.js on lines 270..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 168.

    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 disable next and disable prev', function () {
    
                var link1 = 'url1; rel="link"';
                var link2 = 'url2; rel="link"';
                var testLinkHeader = link1 + ',' + link2;
    Severity: Major
    Found in td.tests/serverspec/threatmodelcontroller_spec.js and 3 other locations - About 5 hrs to fix
    td.tests/serverspec/threatmodelcontroller_spec.js on lines 501..518
    td.tests/serverspec/threatmodelcontroller_spec.js on lines 520..537
    td.tests/serverspec/threatmodelcontroller_spec.js on lines 539..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 152.

    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 disable next and enable prev', function () {
    
                var link1 = 'url1; rel="link"';
                var link2 = 'url2; rel="prev"';
                var testLinkHeader = link1 + ',' + link2;
    Severity: Major
    Found in td.tests/serverspec/threatmodelcontroller_spec.js and 3 other locations - About 5 hrs to fix
    td.tests/serverspec/threatmodelcontroller_spec.js on lines 501..518
    td.tests/serverspec/threatmodelcontroller_spec.js on lines 520..537
    td.tests/serverspec/threatmodelcontroller_spec.js on lines 558..575

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

    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 enable next and disable prev', function () {
    
                var link1 = 'url1; rel="next"';
                var link2 = 'url2; rel="link"';
                var testLinkHeader = link1 + ',' + link2;
    Severity: Major
    Found in td.tests/serverspec/threatmodelcontroller_spec.js and 3 other locations - About 5 hrs to fix
    td.tests/serverspec/threatmodelcontroller_spec.js on lines 520..537
    td.tests/serverspec/threatmodelcontroller_spec.js on lines 539..556
    td.tests/serverspec/threatmodelcontroller_spec.js on lines 558..575

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

    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 enable next and enable prev', function () {
    
                var link1 = 'url1; rel="next"';
                var link2 = 'url2; rel="prev"';
                var testLinkHeader = link1 + ',' + link2;
    Severity: Major
    Found in td.tests/serverspec/threatmodelcontroller_spec.js and 3 other locations - About 5 hrs to fix
    td.tests/serverspec/threatmodelcontroller_spec.js on lines 501..518
    td.tests/serverspec/threatmodelcontroller_spec.js on lines 539..556
    td.tests/serverspec/threatmodelcontroller_spec.js on lines 558..575

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

    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

            expect(mockRepository.model.calls.argsFor(0)[0]).toEqual({ organisation: testOrg, repo: testRepo, branch: testBranch, model: testModel });
    Severity: Major
    Found in td.tests/serverspec/threatmodelcontroller_spec.js and 1 other location - About 1 hr to fix
    td.tests/serverspec/threatmodelcontroller_spec.js on lines 431..431

    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

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

            expect(mockRepository.deleteModel.calls.argsFor(0)[0]).toEqual({ organisation: testOrg, repo: testRepo, branch: testBranch, model: testModel });
    Severity: Major
    Found in td.tests/serverspec/threatmodelcontroller_spec.js and 1 other location - About 1 hr to fix
    td.tests/serverspec/threatmodelcontroller_spec.js on lines 264..264

    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

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

            expect(mockRepository.models.calls.argsFor(0)[0]).toEqual({ organisation: testOrg, repo: testRepo, branch: testBranch });
    Severity: Minor
    Found in td.tests/serverspec/threatmodelcontroller_spec.js and 1 other location - About 50 mins to fix
    td.tests/serverspec/threatmodelcontroller_spec.js on lines 146..146

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

            expect(mockRepository.branches.calls.argsFor(0)[0]).toEqual({ organisation: testOrg, repo: testRepo, page: testPage });
    Severity: Minor
    Found in td.tests/serverspec/threatmodelcontroller_spec.js and 1 other location - About 50 mins to fix
    td.tests/serverspec/threatmodelcontroller_spec.js on lines 208..208

    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

    There are no issues that match your filters.

    Category
    Status