yadaguru/yadaguru-app

View on GitHub

Showing 29 of 29 total issues

Function utilService has 99 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  var utilService = function() {

    var utils = {};

    /**
Severity: Major
Found in src/services/utilsService.js - About 3 hrs to fix

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

            function ($scope, $moment, helpService, yadaApi, modalService, localStorage, errorService, authService) {
    
              $scope.obStep = 1;
              $scope.minDate = $moment().toDate();
              $scope.initDate = $moment('20160201', 'YYYYMMDD').toDate();
    Severity: Major
    Found in src/directives/onboarding.js - About 3 hrs to fix

      Function routeResolver has 74 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        var routeResolver = function() {
      
          this.$get = function() {
            return this;
          };
      Severity: Major
      Found in src/services/routeResolverProvider.js - About 2 hrs to fix

        Function googleCalendarService has 74 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          var googleCalendarService = function(Utils, $rootScope) {
        
            var CLIENT_ID = '240339457257-tqhtiqq9irs42ite1tmp1gjii23hg3uo.apps.googleusercontent.com';
            var SCOPES = ['https://www.googleapis.com/auth/calendar'];
            var calendarId;
        Severity: Major
        Found in src/services/googleCalendarService.js - About 2 hrs to fix

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

              yadaAPI.delete = function(resource, resourceId, isAuthRoute) {
                var route = apiRoute + resource + '/' + resourceId + '/';
          
                isAuthRoute = typeof isAuthRoute === 'undefined' ? true : isAuthRoute;
                var config = isAuthRoute ? authHeaderConfig : undefined;
          Severity: Major
          Found in src/services/apiService.js and 1 other location - About 2 hrs to fix
          src/services/apiService.js on lines 37..44

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

          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

              yadaAPI.getOne = function(resource, resourceId, isAuthRoute) {
                var route = apiRoute + resource + '/' + resourceId + '/';
          
                isAuthRoute = typeof isAuthRoute === 'undefined' ? true : isAuthRoute;
                var config = isAuthRoute ? authHeaderConfig : undefined;
          Severity: Major
          Found in src/services/apiService.js and 1 other location - About 2 hrs to fix
          src/services/apiService.js on lines 64..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 86.

          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

          gulp.task('build-vendor-css', function() {
            return gulp.src(paths.src.vendor.css)
              .pipe(concat('vendor.css'))
              .pipe(gulp.dest(paths.dest.css));
          });
          Severity: Major
          Found in build/tasks/build.js and 1 other location - About 2 hrs to fix
          build/tasks/build.js on lines 21..25

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

          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

          gulp.task('build-vendor-js', function() {
            return gulp.src(paths.src.vendor.js)
              .pipe(concat('vendor.js'))
              .pipe(gulp.dest(paths.dest.js));
          });
          Severity: Major
          Found in build/tasks/build.js and 1 other location - About 2 hrs to fix
          build/tasks/build.js on lines 31..35

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

          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

          Function apiService has 52 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            var apiService = function($http, constants, $q, authService) {
              var yadaAPI = {};
          
              yadaAPI.reminders = {};
              var apiRoute = constants.HOSTNAME + constants.API_ROUTE;
          Severity: Major
          Found in src/services/apiService.js - About 2 hrs to fix

            Function route has 50 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                this.route = (function(routeConfig) {
            
                  var resolve = function(url, baseName, path, controllerAs, secure) {
                      if (!path) {
                        path = '';
            Severity: Minor
            Found in src/services/routeResolverProvider.js - About 2 hrs to fix

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

                var iCalService = function(SaveAs) {
                  var iCalFactory = function() {
                    // Ideally if the browser is MSIE < 10 the iCal save button shouldn't be shown
                    if (navigator.userAgent.indexOf('MSIE') > -1 &&
                        navigator.userAgent.indexOf('MSIE 10') === -1) {
              Severity: Minor
              Found in src/services/iCalService.js - About 1 hr to fix

                Function showModal has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                      modalFactory.showModal = function(content, options) {
                
                        options = options || {};
                
                        var defaultController = function($scope, $modalInstance, contentItem) {
                Severity: Minor
                Found in src/services/modalService.js - About 1 hr to fix

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

                        yadaApi.getOne('content_items', 'contact', false).then(function(resp) {
                          $scope.contact = resp.data[0].content;
                        }, function() {
                          $scope.contact = 'Error loading contact info.';
                        });
                  Severity: Major
                  Found in src/faqs/faqsController.js and 2 other locations - About 1 hr to fix
                  src/faqs/faqsController.js on lines 19..23
                  src/privacy/privacyController.js on lines 12..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 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

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

                        yadaApi.getOne('content_items', 'privacy', false).then(function(resp) {
                          $scope.content = resp.data[0].content;
                        }, function() {
                          $scope.content = 'Error loading privacy policy.';
                        });
                  Severity: Major
                  Found in src/privacy/privacyController.js and 2 other locations - About 1 hr to fix
                  src/faqs/faqsController.js on lines 13..17
                  src/faqs/faqsController.js on lines 19..23

                  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

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

                        yadaApi.getOne('content_items', 'faqs', false).then(function(resp) {
                          $scope.faqs = resp.data[0].content;
                        }, function() {
                          $scope.faqs = 'Error loading FAQs.';
                        });
                  Severity: Major
                  Found in src/faqs/faqsController.js and 2 other locations - About 1 hr to fix
                  src/faqs/faqsController.js on lines 13..17
                  src/privacy/privacyController.js on lines 12..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 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

                  Function addCalendarEvents has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      function addCalendarEvents(events, school, dueDate, callback) {
                        // authorizes YadaGuru with user's Google account
                        gapi.auth.authorize({
                          'client_id': CLIENT_ID,
                          'scope': SCOPES,
                  Severity: Minor
                  Found in src/services/googleCalendarService.js - About 1 hr to fix

                    Function resolve has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                          var resolve = function(url, baseName, path, controllerAs, secure) {
                              if (!path) {
                                path = '';
                              }
                    
                    
                    Severity: Minor
                    Found in src/services/routeResolverProvider.js - About 1 hr to fix

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

                      gulp.task('build-images', function() {
                        return gulp.src(paths.src.images)
                          .pipe(gulp.dest(paths.dest.images))
                      });
                      Severity: Major
                      Found in build/tasks/build.js and 1 other location - About 1 hr to fix
                      build/tasks/build.js on lines 49..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 64.

                      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

                      gulp.task('build-requirejs', function() {
                        return gulp.src(paths.src.requirejs)
                          .pipe(gulp.dest(paths.dest.js))
                      });
                      Severity: Major
                      Found in build/tasks/build.js and 1 other location - About 1 hr to fix
                      build/tasks/build.js on lines 57..60

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

                      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

                      Function groupBy has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          utils.groupBy = function(arrayOfObjects, propToGroupBy) {
                            var groupArray = [],
                                match;
                      
                            var newGroup = function(initObj, groupProp) {
                      Severity: Minor
                      Found in src/services/utilsService.js - About 1 hr to fix
                        Severity
                        Category
                        Status
                        Source
                        Language