dsd-meetme/frontend

View on GitHub
app/components/user/meeting/nmController.js

Summary

Maintainability
F
6 days
Test Coverage

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

    var controller = function (userResources, plannerResources, mixedContentToArray, $scope, $location, $routeParams) {

        var mode = 'c';
        var c = this;
        var changedEvents = [];
Severity: Major
Found in app/components/user/meeting/nmController.js - About 2 days to fix

    File nmController.js has 421 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    (function () {
    
        var controller = function (userResources, plannerResources, mixedContentToArray, $scope, $location, $routeParams) {
    
            var mode = 'c';
    Severity: Minor
    Found in app/components/user/meeting/nmController.js - About 6 hrs to fix

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

              c.submit = function () {
                  var form = $scope.meetingInfoForm;
                  var events;
                  if (!c.showEmptyState) {
                      events = calendar.fullCalendar('clientEvents');
      Severity: Minor
      Found in app/components/user/meeting/nmController.js - About 1 hr to fix

        Function saveMeetingTimeslots has 31 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                var saveMeetingTimeslots = function (meetingId, events, redirect, showPopupCondition, isUpdate) {
                    var counter = 0;
                    var groupId;
                    if (isUpdate){
                        groupId = c.groupId;
        Severity: Minor
        Found in app/components/user/meeting/nmController.js - About 1 hr to fix

          Function updateMeeting has 28 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  var updateMeeting = function (events) {
                      var alsoEditedEvents = false;
                      var newEvents = backendEventAdapter(checkNewEvents(events), true);
                      var modifiedEvents = backendEventAdapter(changedEvents, false);
                      console.log(newEvents);
          Severity: Minor
          Found in app/components/user/meeting/nmController.js - About 1 hr to fix

            Function controller has 6 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                var controller = function (userResources, plannerResources, mixedContentToArray, $scope, $location, $routeParams) {
            Severity: Minor
            Found in app/components/user/meeting/nmController.js - About 45 mins to fix

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

                      var saveMeetingTimeslots = function (meetingId, events, redirect, showPopupCondition, isUpdate) {
              Severity: Minor
              Found in app/components/user/meeting/nmController.js - About 35 mins to fix

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

                        var backendEventAdapter = function (events, switcher) {
                            var adaptedEvents = [];
                            if (switcher) {
                                for (var i = 0; i < events.length; i++) {
                                    adaptedEvents.push({
                Severity: Major
                Found in app/components/user/meeting/nmController.js and 1 other location - About 1 day to fix
                app/components/user/composeSchedule/cschedController.js on lines 17..41

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

                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

                                        for (var i = 0; i < response.length; i++) {
                                            splittedTimeStart = response[i].time_start.split(' ');
                                            splittedTimeEnd = response[i].time_end.split(' ');
                                            c.events.push({
                                                title: '',
                Severity: Major
                Found in app/components/user/meeting/nmController.js and 1 other location - About 5 hrs to fix
                app/components/user/composeSchedule/cschedController.js on lines 81..92

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

                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 checkNewEvents = function (events) {
                            var newEvents = [];
                
                            for (var i = 0; i < events.length; i++) {
                                if (events[i].new === true) {
                Severity: Major
                Found in app/components/user/meeting/nmController.js and 1 other location - About 2 hrs to fix
                app/components/user/composeSchedule/cschedController.js on lines 8..16

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

                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/user/meeting/nmController.js and 6 other locations - About 1 hr to fix
                app/components/organization/dashboard/odashController.js on lines 30..38
                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/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

                                    if (newEvents.length === 0 && modifiedEvents[1].length === 0) {
                                        c.confirmPopup.hide();
                                        $location.path('/user');
                
                                    }
                Severity: Major
                Found in app/components/user/meeting/nmController.js and 1 other location - About 1 hr to fix
                app/components/user/composeSchedule/cschedController.js on lines 231..234

                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

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

                            select: function (start, end) {
                                calendar.fullCalendar('renderEvent',
                                    {
                                        start: start,
                                        end: end,
                Severity: Minor
                Found in app/components/user/meeting/nmController.js and 1 other location - About 55 mins to fix
                app/components/user/composeSchedule/cschedController.js on lines 259..269

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

                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