dsd-meetme/frontend

View on GitHub
app/components/user/dashboard/udashController.js

Summary

Maintainability
F
6 days
Test Coverage

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

    var controller = function ($scope, dataPublisher, mixedContentToArray, userResources, plannerResources, configService, objectResetFields) {

        /*
         Gets the meetings relative to a given group.
         These meetings are stored in the meetings properties of the given group.
Severity: Major
Found in app/components/user/dashboard/udashController.js - About 2 days to fix

    File udashController.js has 451 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    (function () {
    
        var controller = function ($scope, dataPublisher, mixedContentToArray, userResources, plannerResources, configService, objectResetFields) {
    
            /*
    Severity: Minor
    Found in app/components/user/dashboard/udashController.js - About 6 hrs to fix

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

                  submit: function () {
                      var form = $scope.editScheduleForm;
                      this.invalidFields.nameReq = form.name.$error.required;
                      this.invalidFields.urlReq = form.url.$error.required;
                      this.invalidFields.urlVal = form.url.$error.url;
      Severity: Major
      Found in app/components/user/dashboard/udashController.js - About 2 hrs to fix

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

                    submit: function () {
        
                        if (this.calendars.length === 0) {
                            this.errors.push('Before importing a schedule select it after having pressed get schedules')
                        }
        Severity: Minor
        Found in app/components/user/dashboard/udashController.js - About 1 hr to fix

          Function getCalendars has 26 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                      getCalendars: function () {
                          var form = $scope.importScheduleForm;
                          this.invalidFields.urlRequired = form.url.$error.required;
                          this.invalidFields.urlVal = form.url.$error.url;
                          this.invalidFields.usernameRequired = form.username.$error.required;
          Severity: Minor
          Found in app/components/user/dashboard/udashController.js - About 1 hr to fix

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

                var controller = function ($scope, dataPublisher, mixedContentToArray, userResources, plannerResources, configService, objectResetFields) {
            Severity: Major
            Found in app/components/user/dashboard/udashController.js - About 50 mins to fix

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

                          userResources.userGroups.query({current : 1})
                              .$promise.then(function (response) {
                                  c.meetings.toBePlanned = processMeetings(response);
                                  pages = Math.ceil(c.meetings.toBePlanned.length / 10);
                                  c.pagination.meetingsToBePlanned.pages = pages;
              Severity: Major
              Found in app/components/user/dashboard/udashController.js and 1 other location - About 4 hrs to fix
              app/components/user/dashboard/udashController.js on lines 112..119

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

              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

                          plannerResources.plannerManagedMeetings.query({current: 1})
                              .$promise.then(function (response) {
                                  c.meetings.managed = processMeetings(response);
              
                                  pages = Math.ceil(c.meetings.managed.length / 10);
              Severity: Major
              Found in app/components/user/dashboard/udashController.js and 1 other location - About 4 hrs to fix
              app/components/user/dashboard/udashController.js on lines 97..103

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

              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

                                      dataPublisher.publish(apiDomain + '/employees/calendars/caldav', {
                                          name: selectedCalendars[i],
                                          url: this.credentials.url,
                                          username: this.credentials.username,
                                          password: this.credentials.password,
              Severity: Major
              Found in app/components/user/dashboard/udashController.js and 1 other location - About 4 hrs to fix
              app/components/organization/dashboard/odashController.js on lines 241..258

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

                      c.viewSections = {
                          meetings: true,
                          schedules: false,
                          showMeetings: function () {
                              this.schedules = false;
              Severity: Major
              Found in app/components/user/dashboard/udashController.js and 1 other location - About 2 hrs to fix
              app/components/organization/dashboard/odashController.js on lines 41..52

              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/user/dashboard/udashController.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/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

                              userResources.userSchedule.remove({calendarId: c.editSchedule.data.id})
                                  .$promise.then(function () {
                                      getSchedules();
                                      c.confirmPopup.hide();
                                  }, function(){
              Severity: Minor
              Found in app/components/user/dashboard/udashController.js and 1 other location - About 35 mins to fix
              app/components/user/dashboard/udashController.js on lines 328..334

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

              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

                          userResources.userSchedule.remove({calendarId: id})
                              .$promise.then(function () {
                                  getSchedules();
                                  c.confirmPopup.hide();
                              }, function(){
              Severity: Minor
              Found in app/components/user/dashboard/udashController.js and 1 other location - About 35 mins to fix
              app/components/user/dashboard/udashController.js on lines 402..408

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

              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