CleverStack/angular-seed

View on GitHub

Showing 114 of 114 total issues

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

            if ( inheritedProviders ) {
              inheritedProviders.forEach( function( inheritedProvider ) {
                var provider = $injector.get( inheritedProvider );
                if ( !provider ) {
                  throw new Error( 'Unable to inject "' + inheritedProvider + '"' );
Severity: Major
Found in app/modules/cs_common/providers/HelpersProvider.js and 1 other location - About 2 hrs to fix
app/modules/auth/providers/AuthHelpersProvider.js on lines 15..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 75.

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

  Carousel.prototype.slide = function (type, next) {
    var $active   = this.$element.find('.item.active')
    var $next     = next || $active[type]()
    var isCycling = this.interval
    var direction = type == 'next' ? 'left' : 'right'
Severity: Minor
Found in app/scripts/bootstrap.js - About 1 hr to fix

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

                  roles: function() {
                    return RoleService
                      .list()
                      .then( function( roles ) {
                        return roles;
    Severity: Major
    Found in app/modules/roles/providers/RoleHelpersProvider.js and 2 other locations - About 1 hr to fix
    app/modules/roles/providers/RoleHelpersProvider.js on lines 51..60
    app/modules/roles/providers/RoleHelpersProvider.js on lines 62..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 70.

    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

                  permissions: function() {
                    return PermissionService
                      .list()
                      .then( function( permissions ) {
                        return permissions;
    Severity: Major
    Found in app/modules/roles/providers/RoleHelpersProvider.js and 2 other locations - About 1 hr to fix
    app/modules/roles/providers/RoleHelpersProvider.js on lines 51..60
    app/modules/roles/providers/RoleHelpersProvider.js on lines 146..155

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

    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

                  users: function() {
                    return UserService
                      .list()
                      .then( function( users ) {
                        return users;
    Severity: Major
    Found in app/modules/roles/providers/RoleHelpersProvider.js and 2 other locations - About 1 hr to fix
    app/modules/roles/providers/RoleHelpersProvider.js on lines 62..71
    app/modules/roles/providers/RoleHelpersProvider.js on lines 146..155

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

    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

        $scope.cancel = function () {
          if ( $scope.user && typeof $scope.user.$get === 'function' ) {
            $scope.user.$get();
          }
          $modalInstance.dismiss( 'cancel' );
    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 42..47
    app/modules/roles/controllers/RoleEditController.js on lines 46..51

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

    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

        $scope.cancel       = function () {
          if ( $scope.permission && typeof $scope.permission.$get === 'function' ) {
            $scope.permission.$get();
          }
          $modalInstance.dismiss( 'cancel' );
    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 42..47
    app/modules/roles/controllers/RoleEditController.js on lines 46..51

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

    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

        $scope.cancel       = function () {
          if ( $scope.role && typeof $scope.role.$get === 'function' ) {
            $scope.role.$get();
          }
          $modalInstance.dismiss( 'cancel' );
    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 42..47
    app/modules/roles/controllers/PermissionEditController.js on lines 42..47

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

    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

      $(window).on('load', function () {
        $('[data-spy="scroll"]').each(function () {
          var $spy = $(this)
          $spy.scrollspy($spy.data())
        })
    Severity: Major
    Found in app/scripts/bootstrap.js and 1 other location - About 1 hr to fix
    app/scripts/bootstrap.js on lines 490..495

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

    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

        $routeProvider
          .when( '/', {
            templateUrl: TemplateProvider.view( 'app', 'home' ),
            controller: 'HomeController',
            public: true
    Severity: Major
    Found in app/modules/app/module.js and 1 other location - About 1 hr to fix
    app/modules/auth/module.js on lines 89..99

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

    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

      $(window).on('load', function () {
        $('[data-ride="carousel"]').each(function () {
          var $carousel = $(this)
          $carousel.carousel($carousel.data())
        })
    Severity: Major
    Found in app/scripts/bootstrap.js and 1 other location - About 1 hr to fix
    app/scripts/bootstrap.js on lines 1736..1741

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

    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

        $routeProvider
          .when( '/signUp', {
            templateUrl : TemplateProvider.view( 'auth', 'signUp' ),
            controller  : 'SignUpController',
            public      : true
    Severity: Major
    Found in app/modules/auth/module.js and 1 other location - About 1 hr to fix
    app/modules/app/module.js on lines 99..109

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

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

            helpers.openUserModal = function( user, currentUser ) {
              ModalFactory.open( user, '/modules/auth/views/users/form.html', {
                controller: 'UserEditController',
                resolve: {
                  user: function() {
    Severity: Minor
    Found in app/modules/auth/providers/AuthHelpersProvider.js - About 1 hr to fix

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

        Tooltip.prototype.show = function () {
          var e = $.Event('show.bs.'+ this.type)
      
          if (this.hasContent() && this.enabled) {
            this.$element.trigger(e)
      Severity: Minor
      Found in app/scripts/bootstrap.js - About 1 hr to fix

        Function openDeletePermissionModal has 38 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                helpers.openDeletePermissionModal = function( permission ) {
                  ModalFactory.open( {}, '/modules/cs_modal/views/confirmModal.html', {
                    resolve: {
                      title: function() {
                        return 'Delete the "' + permission.action + '" Permission?';
        Severity: Minor
        Found in app/modules/roles/providers/RoleHelpersProvider.js - About 1 hr to fix

          Function openDeleteRoleModal has 38 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  helpers.openDeleteRoleModal = function( role ) {
                    ModalFactory.open( {}, '/modules/cs_modal/views/confirmModal.html', {
                      resolve: {
                        title: function() {
                          return 'Delete the "' + role.name + '" Role?';
          Severity: Minor
          Found in app/modules/roles/providers/RoleHelpersProvider.js - About 1 hr to fix

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

                        {
                          label:          'User',
                          href:           '/user/new',
                          class:          'fa-user',
                          requiresSignIn: true,
            Severity: Major
            Found in app/modules/app/module.js and 2 other locations - About 1 hr to fix
            app/modules/app/module.js on lines 63..73
            app/modules/app/module.js on lines 74..84

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

                        {
                          label:          'Role',
                          href:           '/role/new',
                          class:          'fa-group',
                          requiresSignIn: true,
            Severity: Major
            Found in app/modules/app/module.js and 2 other locations - About 1 hr to fix
            app/modules/app/module.js on lines 52..62
            app/modules/app/module.js on lines 74..84

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

                        {
                          label:          'Permission',
                          href:           '/permission/new',
                          class:          'fa-legal',
                          requiresSignIn: true,
            Severity: Major
            Found in app/modules/app/module.js and 2 other locations - About 1 hr to fix
            app/modules/app/module.js on lines 52..62
            app/modules/app/module.js on lines 63..73

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

                    function showMessage() {
                      if( _( $scope.message ).isUndefined() || _( $scope.message ).isEmpty() ) {
                        $log.warn( 'Empty message received' );
                        return;
                      }
            Severity: Minor
            Found in app/modules/cs_messenger/scripts/messenger_directive.js - About 1 hr to fix
              Severity
              Category
              Status
              Source
              Language