CleverStack/angular-seed

View on GitHub

Showing 114 of 114 total issues

Function openPermissionModal has 34 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        helpers.openPermissionModal = function( permission ) {
          ModalFactory.open( permission, '/modules/roles/views/permission/form.html', {
            controller: 'PermissionEditController',
            resolve: {
              permission: function() {
Severity: Minor
Found in app/modules/roles/providers/RoleHelpersProvider.js - About 1 hr to fix

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

                    if ( typeof user === 'object' ) {
                      user.Role = user.Role && !isNaN(user.Role.id) ? parseInt(user.Role.id, 10) : user.Role;
                      return user;
                    } else if ( user !== false && user !== undefined ) {
    Severity: Major
    Found in app/modules/auth/providers/AuthHelpersProvider.js and 1 other location - About 1 hr to fix
    app/modules/auth/providers/AuthHelpersProvider.js on lines 36..40

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

    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

                        .then( function( user ) {
                          user.Role = user.Role && !isNaN(user.Role.id) ? parseInt(user.Role.id, 10) : user.Role;
    
                          return user;
                        });
    Severity: Major
    Found in app/modules/auth/providers/AuthHelpersProvider.js and 1 other location - About 1 hr to fix
    app/modules/auth/providers/AuthHelpersProvider.js on lines 30..33

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

    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 exports has 33 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    module.exports = function (grunt) {
      'use strict';
    
      require('time-grunt')(grunt);
      require('load-grunt-tasks')(grunt);
    Severity: Minor
    Found in Gruntfile.js - About 1 hr to fix

      Function applyPlacement has 33 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        Tooltip.prototype.applyPlacement = function(offset, placement) {
          var replace
          var $tip   = this.tip()
          var width  = $tip[0].offsetWidth
          var height = $tip[0].offsetHeight
      Severity: Minor
      Found in app/scripts/bootstrap.js - About 1 hr to fix

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

              if ( !!$scope.role.id ) {
                promise = $scope.role.$save();
              } else {
                promise = RoleService.create( $scope.role );
              }
        Severity: Major
        Found in app/modules/roles/controllers/RoleEditController.js and 2 other locations - About 1 hr to fix
        app/modules/auth/controllers/UserEditController.js on lines 25..29
        app/modules/roles/controllers/PermissionEditController.js on lines 25..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 60.

        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

              if ( !!$scope.user.id ) {
                promise = $scope.user.$save();
              } else {
                promise = UserService.create( $scope.user );
              }
        Severity: Major
        Found in app/modules/auth/controllers/UserEditController.js and 2 other locations - About 1 hr to fix
        app/modules/roles/controllers/PermissionEditController.js on lines 25..29
        app/modules/roles/controllers/RoleEditController.js on lines 29..33

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

        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

              if ( !!$scope.permission.id ) {
                promise = $scope.permission.$save();
              } else {
                promise = PermissionService.create( $scope.permission );
              }
        Severity: Major
        Found in app/modules/roles/controllers/PermissionEditController.js and 2 other locations - About 1 hr to fix
        app/modules/auth/controllers/UserEditController.js on lines 25..29
        app/modules/roles/controllers/RoleEditController.js on lines 29..33

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

        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 show has 31 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          Collapse.prototype.show = function () {
            if (this.transitioning || this.$element.hasClass('in')) return
        
            var startEvent = $.Event('show.bs.collapse')
            this.$element.trigger(startEvent)
        Severity: Minor
        Found in app/scripts/bootstrap.js - About 1 hr to fix

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

              $provide.decorator('modalBackdropDirective', [ '$delegate', function( $delegate ) {
                $delegate[0].templateUrl = ['modules/cs_modal/views/', $delegate[0].name, '.html'].join('');
                return $delegate;
              }]);
          Severity: Major
          Found in app/modules/cs_modal/module.js and 1 other location - About 1 hr to fix
          app/modules/cs_modal/module.js on lines 21..24

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

          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

              $provide.decorator('modalWindowDirective', [ '$delegate', function( $delegate ) {
                $delegate[0].templateUrl = ['modules/cs_modal/views/', $delegate[0].name, '.html'].join('');
                return $delegate;
              }]);
          Severity: Major
          Found in app/modules/cs_modal/module.js and 1 other location - About 1 hr to fix
          app/modules/cs_modal/module.js on lines 16..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 59.

          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 backdrop has 30 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            Modal.prototype.backdrop = function (callback) {
              var that    = this
              var animate = this.$element.hasClass('fade') ? 'fade' : ''
          
              if (this.isShown && this.options.backdrop) {
          Severity: Minor
          Found in app/scripts/bootstrap.js - About 1 hr to fix

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

              Modal.prototype.show = function (_relatedTarget) {
                var that = this
                var e    = $.Event('show.bs.modal', { relatedTarget: _relatedTarget })
            
                this.$element.trigger(e)
            Severity: Minor
            Found in app/scripts/bootstrap.js - About 1 hr to fix

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

                    function switchRouteMatcher(on, when, whenProperties) {
                      // TODO(i): this code is convoluted and inefficient, we should construct the route matching
                      //   regex only once and then reuse it
              
                      // Escape regexp special characters.
              Severity: Minor
              Found in app/modules/auth/providers/SessionProvider.js - About 1 hr to fix

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

                        getData   : function($defer, params) {
                
                          // $scope.toggleFilter = function(params) {
                          //   params.settings().$scope.show_filter = !params.settings().$scope.show_filter;
                          // };
                Severity: Minor
                Found in app/modules/cs_table/controllers/CleverTableController.js - About 1 hr to fix

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

                        function ResourceFactory( resourceUrl, defaultParams, actions ) {
                  
                          /**
                           * @ngdoc function
                           * @name builder
                  Severity: Minor
                  Found in app/modules/cs_common/providers/ResourceFactoryProvider.js - About 1 hr to fix

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

                    module.exports = function(config) {
                      config.set({
                        // list of files / patterns to load in the browser
                    
                        // **/*.js: All files with a "js" extension in all subdirectories
                    Severity: Minor
                    Found in test-unit.conf.js - About 1 hr to fix

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

                                        if ( currentUser.Role.Permissions ) {
                                          currentUser.Role.Permissions.every( function( perm ) {
                                            if ( perm.action === permission ) {
                                              hasPermission = true;
                                              return false;
                      Severity: Major
                      Found in app/modules/auth/providers/SessionProvider.js and 1 other location - About 1 hr to fix
                      app/modules/roles/providers/RoleHelpersProvider.js on lines 211..219

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

                      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

                                  if (user && user.role && user.Role.Permissions) {
                                    user.Role.Permissions.every(function(perm) {
                                      if (perm.action === permission) {
                                        hasPerm = true;
                                        return false;
                      Severity: Major
                      Found in app/modules/roles/providers/RoleHelpersProvider.js and 1 other location - About 1 hr to fix
                      app/modules/auth/providers/SessionProvider.js on lines 356..364

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

                      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 activate has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        Tab.prototype.activate = function (element, container, callback) {
                          var $active    = container.find('> .active')
                          var transition = callback
                            && $.support.transition
                            && $active.hasClass('fade')
                      Severity: Minor
                      Found in app/scripts/bootstrap.js - About 1 hr to fix
                        Severity
                        Category
                        Status
                        Source
                        Language