whitef0x0/tellform

View on GitHub
public/modules/forms/tests/unit/directives/edit-form.client.directive.test.js

Summary

Maintainability
D
1 day
Test Coverage

Function update has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

            scope.update = function(updateImmediately, data, isDiffed, refreshAfterUpdate, cb){

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

                form_fields: [
                    {fieldType:'textfield', title:'First Name', fieldOptions: [], fieldValue: '', required: true, disabled: false, deletePreserved: false, _id: 'ed873933b0ce121f1deafab9'},
                    {fieldType:'checkbox', title:'nascar',      fieldOptions: [], fieldValue: '', required: true, disabled: false, deletePreserved: false, _id: 'ed83b0ce121f17393deafab9'},
                    {fieldType:'checkbox', title:'hockey',      fieldOptions: [], fieldValue: '', required: true, disabled: false, deletePreserved: false, _id: 'ed8317393deab0ce121ffab9'}
                ],
    public/modules/forms/tests/unit/directives/configure-form.client.directive.test.js on lines 24..28
    public/modules/forms/tests/unit/directives/edit-form-submissions.client.directive.test.js on lines 36..40
    public/modules/forms/tests/unit/directives/submit-form.client.directive.test.js on lines 42..45
    public/modules/forms/tests/unit/directives/submit-form.client.directive.test.js on lines 46..49

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

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

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

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

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

    Refactorings

    Further Reading

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

            var newFakeModal = function(){
                var modal = {
                    opened: true,
                    close: function( item ) {
                        //The user clicked OK on the modal dialog, call the stored confirm callback with the selected item
    public/modules/forms/tests/unit/controllers/admin-form.client.controller.test.js on lines 147..167

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

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

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

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

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

    Refactorings

    Further Reading

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

            beforeEach(function() {
                jasmine.addMatchers({
                    toEqualData: function(util, customEqualityTesters) {
                        return {
                            compare: function(actual, expected) {
    public/modules/forms/tests/unit/controllers/admin-form.client.controller.test.js on lines 73..85
    public/modules/forms/tests/unit/controllers/list-forms.client.controller.test.js on lines 63..75
    public/modules/forms/tests/unit/directives/configure-form.client.directive.test.js on lines 46..58
    public/modules/forms/tests/unit/directives/edit-form-submissions.client.directive.test.js on lines 118..130
    public/modules/forms/tests/unit/directives/submit-form.client.directive.test.js on lines 109..121
    public/modules/forms/tests/unit/services/current-form.client.service.test.js on lines 26..38
    public/modules/users/tests/unit/services/auth.client.service.test.js on lines 26..38
    public/modules/users/tests/unit/services/authorizer.client.service.test.js on lines 26..38
    public/modules/users/tests/unit/services/user.client.service.test.js on lines 38..50

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

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

            var sampleUser = {
                firstName: 'Full',
                lastName: 'Name',
                email: 'test@test.com',
                username: 'test@test.com',
    public/modules/forms/tests/unit/controllers/admin-form.client.controller.test.js on lines 15..24
    public/modules/forms/tests/unit/controllers/submit-form.client.controller.test.js on lines 16..25
    public/modules/forms/tests/unit/directives/configure-form.client.directive.test.js on lines 9..18
    public/modules/forms/tests/unit/directives/edit-form-submissions.client.directive.test.js on lines 9..18
    public/modules/forms/tests/unit/directives/field.client.directive.test.js on lines 65..74
    public/modules/forms/tests/unit/directives/submit-form.client.directive.test.js on lines 27..36
    public/modules/users/tests/unit/services/user.client.service.test.js on lines 10..19

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 50.

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

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

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

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

    Refactorings

    Further Reading

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

            beforeEach(inject(function($uibModal) {
                var modal = newFakeModal();
                spyOn($uibModal, 'open').and.returnValue(modal);
            }));
    public/modules/forms/tests/unit/controllers/admin-form.client.controller.test.js on lines 170..173

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

    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