dsd-meetme/frontend

View on GitHub
app/components/organization/dashboard/odashController.js

Summary

Maintainability
F
1 wk
Test Coverage

Function controller has 233 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    var controller = function ($scope, orgResources, arrayToUrlParams, mixedContentToArray) {

        var c = this;

        var getUsers = function () {
Severity: Major
Found in app/components/organization/dashboard/odashController.js - About 1 day to fix

    Function submit has 48 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

                submit: function () {
                    var validMembers = [];
                    var validationStatus;
                    angular.forEach(this.members, function (value, key) {
                        if (value === true) {
    Severity: Minor
    Found in app/components/organization/dashboard/odashController.js - About 1 hr to fix

      Function submit has 30 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

                  submit: function () {
                      var form = $scope.addUserForm;
                      //Checks the validity of input fields
                      this.invalidFields.nameReq = form.name.$error.required;
                      this.invalidFields.emailReq = form.email.$error.required;
      Severity: Minor
      Found in app/components/organization/dashboard/odashController.js - About 1 hr to fix

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

                    user: {
                        pages: 1,
                        currentPage: 1,
                        utilArray: null,
                        startIndex: 0,
        Severity: Major
        Found in app/components/organization/dashboard/odashController.js and 2 other locations - About 1 day to fix
        app/components/organization/dashboard/odashController.js on lines 78..100
        app/components/organization/group/groupController.js on lines 75..98

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

        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

                    groups: {
                        pages: 1,
                        currentPage: 1,
                        utilArray: null,
                        startIndex: 0,
        Severity: Major
        Found in app/components/organization/dashboard/odashController.js and 2 other locations - About 1 day to fix
        app/components/organization/dashboard/odashController.js on lines 54..77
        app/components/organization/group/groupController.js on lines 75..98

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

        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

                var getUsers = function () {
                    var pages;
                    //employees restful index
                    orgResources.orgUser.query({userId: ''}).$promise
                        .then(function (response) {
        Severity: Major
        Found in app/components/organization/dashboard/odashController.js and 1 other location - About 5 hrs to fix
        app/components/organization/dashboard/odashController.js on lines 19..29

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

        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

                var getGroups = function () {
                    var pages;
                    //employees restful groups index
                    orgResources.orgGroup.query({groupId: ''}).$promise
                        .then(function (response) {
        Severity: Major
        Found in app/components/organization/dashboard/odashController.js and 1 other location - About 5 hrs to fix
        app/components/organization/dashboard/odashController.js on lines 7..17

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

        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

                            orgResources.orgUser.save({userId: ''}, jQuery.param({
                                name: this.name,
                                email: this.email,
                                password: this.password,
                                password_confirmation: this.confirmation_password
        Severity: Major
        Found in app/components/organization/dashboard/odashController.js and 1 other location - About 4 hrs to fix
        app/components/user/dashboard/udashController.js on lines 302..319

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

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

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

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

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

        Refactorings

        Further Reading

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

                                function (response) {
                                    //Puts relevant errors in array 
                                    if (response.status === 422) {
                                        mixedContentToArray.process(response.data, c.addGroup.errors, true);
                                        c.confirmPopup.hide();
        Severity: Major
        Found in app/components/organization/dashboard/odashController.js and 2 other locations - About 3 hrs to fix
        app/components/organization/dashboard/odashController.js on lines 170..178
        app/components/organization/group/groupController.js on lines 303..311

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

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

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

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

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

        Refactorings

        Further Reading

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

                                        }, function (response) {
                                            //Puts relevant errors in array
                                            if (response.status === 422) {
                                                mixedContentToArray.process(response.data, c.addGroup.errors, true);
                                                c.confirmPopup.hide();
        Severity: Major
        Found in app/components/organization/dashboard/odashController.js and 2 other locations - About 3 hrs to fix
        app/components/organization/dashboard/odashController.js on lines 180..188
        app/components/organization/group/groupController.js on lines 303..311

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

        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

                c.viewSections = {
                    users: true,
                    groups: false,
                    showUsers: function () {
                        this.groups = false;
        Severity: Major
        Found in app/components/organization/dashboard/odashController.js and 1 other location - About 2 hrs to fix
        app/components/user/dashboard/udashController.js on lines 132..143

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

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

                c.confirmPopup = {
                    message: '',
                    show: function () {
                        jQuery('#authorizationPopup').modal('show');
                    },
        Severity: Major
        Found in app/components/organization/dashboard/odashController.js and 6 other locations - About 1 hr to fix
        app/components/organization/group/groupController.js on lines 64..72
        app/components/organization/profile/opController.js on lines 20..28
        app/components/user/composeSchedule/cschedController.js on lines 50..58
        app/components/user/dashboard/udashController.js on lines 156..164
        app/components/user/meeting/nmController.js on lines 387..395
        app/components/user/profile/upController.js on lines 12..20

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

        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

                        angular.forEach(this.members, function (value, key) {
                            if (value === true) {
                                validMembers.push(key.toString());
                            }
                        });
        Severity: Minor
        Found in app/components/organization/dashboard/odashController.js and 1 other location - About 50 mins to fix
        app/components/organization/group/groupController.js on lines 283..287

        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