mike-goodwin/owasp-threat-dragon

View on GitHub

Showing 71 of 88 total issues

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

        it('/threatmodel/org/repo/branch/model/update', function (done) {

            spyOn(mockThreatModel, 'update').and.callThrough();
            spyOn(mockHomeController, 'ensureLoggedIn').and.callThrough();
            require('../../td/config/routes.config')(app);
Severity: Major
Found in td.tests/serverspec/routes.config_spec.js and 2 other locations - About 6 hrs to fix
td.tests/serverspec/routes.config_spec.js on lines 373..390
td.tests/serverspec/routes.config_spec.js on lines 392..409

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

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('DELETE /threatmodel/org/repo/branch/model', function (done) {

            spyOn(mockThreatModel, 'deleteModel').and.callThrough();
            spyOn(mockHomeController, 'ensureLoggedIn').and.callThrough();
            require('../../td/config/routes.config')(app);
Severity: Major
Found in td.tests/serverspec/routes.config_spec.js and 2 other locations - About 6 hrs to fix
td.tests/serverspec/routes.config_spec.js on lines 392..409
td.tests/serverspec/routes.config_spec.js on lines 411..428

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

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('/threatmodel/org/repo/branch/model/create', function (done) {

            spyOn(mockThreatModel, 'create').and.callThrough();
            spyOn(mockHomeController, 'ensureLoggedIn').and.callThrough();
            require('../../td/config/routes.config')(app);
Severity: Major
Found in td.tests/serverspec/routes.config_spec.js and 2 other locations - About 6 hrs to fix
td.tests/serverspec/routes.config_spec.js on lines 373..390
td.tests/serverspec/routes.config_spec.js on lines 411..428

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

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

threatmodelcontroller.update = function(req, res) {
    var modelInfo = {
        organisation: req.params.organisation,
        repo: req.params.repo,
        branch: req.params.branch,
Severity: Major
Found in td/controllers/threatmodelcontroller.js and 1 other location - About 6 hrs to fix
td/controllers/threatmodelcontroller.js on lines 81..97

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

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

threatmodelcontroller.create = function(req, res) {
    var modelInfo = {
        organisation: req.params.organisation,
        repo: req.params.repo,
        branch: req.params.branch,
Severity: Major
Found in td/controllers/threatmodelcontroller.js and 1 other location - About 6 hrs to fix
td/controllers/threatmodelcontroller.js on lines 99..115

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

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('/threatmodel/org/repo/branches', function (done) {

            spyOn(mockThreatModel, 'branches').and.callThrough();
            spyOn(mockHomeController, 'ensureLoggedIn').and.callThrough();
            require('../../td/config/routes.config')(app);
Severity: Major
Found in td.tests/serverspec/routes.config_spec.js and 3 other locations - About 6 hrs to fix
td.tests/serverspec/routes.config_spec.js on lines 301..317
td.tests/serverspec/routes.config_spec.js on lines 337..353
td.tests/serverspec/routes.config_spec.js on lines 355..371

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

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('/threatmodel/repos', function (done) {

            spyOn(mockThreatModel, 'repos').and.callThrough();
            spyOn(mockHomeController, 'ensureLoggedIn').and.callThrough();
            require('../../td/config/routes.config')(app);
Severity: Major
Found in td.tests/serverspec/routes.config_spec.js and 3 other locations - About 6 hrs to fix
td.tests/serverspec/routes.config_spec.js on lines 319..335
td.tests/serverspec/routes.config_spec.js on lines 337..353
td.tests/serverspec/routes.config_spec.js on lines 355..371

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

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('/threatmodel/org/repo/branch/models', function (done) {

            spyOn(mockThreatModel, 'models').and.callThrough();
            spyOn(mockHomeController, 'ensureLoggedIn').and.callThrough();
            require('../../td/config/routes.config')(app);
Severity: Major
Found in td.tests/serverspec/routes.config_spec.js and 3 other locations - About 6 hrs to fix
td.tests/serverspec/routes.config_spec.js on lines 301..317
td.tests/serverspec/routes.config_spec.js on lines 319..335
td.tests/serverspec/routes.config_spec.js on lines 355..371

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

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('/threatmodel/org/repo/branch/model/data', function (done) {

            spyOn(mockThreatModel, 'model').and.callThrough();
            spyOn(mockHomeController, 'ensureLoggedIn').and.callThrough();
            require('../../td/config/routes.config')(app);
Severity: Major
Found in td.tests/serverspec/routes.config_spec.js and 3 other locations - About 6 hrs to fix
td.tests/serverspec/routes.config_spec.js on lines 301..317
td.tests/serverspec/routes.config_spec.js on lines 319..335
td.tests/serverspec/routes.config_spec.js on lines 337..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 156.

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

        return datacontext.repos($location.search().page).then(
            function (response) {
                vm.pagination = response.data.pagination;
                vm.pagination.page = parseInt(vm.pagination.page, 10);
                vm.repos = response.data.repos;
Severity: Major
Found in td/public/app/threatmodels/github.js and 1 other location - About 3 hrs to fix
td/public/app/threatmodels/github.js on lines 61..71

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

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

        return datacontext.branches(organisation, repo, $location.search().page).then(
            function (response) {
                vm.pagination = response.data.pagination;
                vm.pagination.page = parseInt(vm.pagination.page, 10);
                vm.branches = response.data.branches;
Severity: Major
Found in td/public/app/threatmodels/github.js and 1 other location - About 3 hrs to fix
td/public/app/threatmodels/github.js on lines 47..57

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

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 return a model path', function () {

        var organisation = 'organisation';
        var repo = 'repo';
        var branch = 'branch';
Severity: Major
Found in td.tests/clientspec/threatmodellocator_spec.js and 1 other location - About 3 hrs to fix
td.tests/clientspec/threatmodellocator_spec.js on lines 67..83

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

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 return a model path based on the route params', function () {

        var organisation = 'organisation';
        var repo = 'repo';
        var branch = 'branch';
Severity: Major
Found in td.tests/clientspec/threatmodellocator_spec.js and 1 other location - About 3 hrs to fix
td.tests/clientspec/threatmodellocator_spec.js on lines 49..65

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

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

Severity
Category
Status
Source
Language