CleverStack/angular-seed

View on GitHub

Showing 114 of 114 total issues

File bootstrap.js has 1190 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*!
 * Bootstrap v3.0.3 (http://getbootstrap.com)
 * Copyright 2013 Twitter, Inc.
 * Licensed under http://www.apache.org/licenses/LICENSE-2.0
 */
Severity: Major
Found in app/scripts/bootstrap.js - About 3 days to fix

    Function $get has 263 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            function( $rootScope, $location, $route, $injector, $log ) {
              var messenger = $injector.has( 'Messenger' ) ? $injector.get( 'Messenger' ) : $log;
    
              if ( !sessionService && sessionServiceName ) {
                sessionService = $injector.get( sessionServiceName );
    Severity: Major
    Found in app/modules/auth/providers/SessionProvider.js - About 1 day to fix

      Similar blocks of code found in 2 locations. 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: Major
      Found in app/modules/roles/providers/RoleHelpersProvider.js and 1 other location - About 1 day to fix
      app/modules/roles/providers/RoleHelpersProvider.js on lines 76..117

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

      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

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

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

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

            $get: function( $injector, $rootScope, $timeout, $location ) {
              var Messenger           = $injector.has( 'Messenger' ) ? $injector.get( 'Messenger' ) : $injector.get( '$log' )
                , RoleService         = $injector.has( 'RoleService' ) ? $injector.get( 'RoleService' ) : false
                , PermissionService   = $injector.has( 'PermissionService' ) ? $injector.get( 'PermissionService' ) : false
                , UserService         = $injector.has( 'UserService' ) ? $injector.get( 'UserService' ) : false
      Severity: Major
      Found in app/modules/roles/providers/RoleHelpersProvider.js - About 1 day to fix

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

          Tooltip.prototype.enter = function (obj) {
            var self = obj instanceof this.constructor ?
              obj : $(obj.currentTarget)[this.type](this.getDelegateOptions()).data('bs.' + this.type)
        
            clearTimeout(self.timeout)
        Severity: Major
        Found in app/scripts/bootstrap.js and 1 other location - About 1 day to fix
        app/scripts/bootstrap.js on lines 1200..1213

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

        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

          Tooltip.prototype.leave = function (obj) {
            var self = obj instanceof this.constructor ?
              obj : $(obj.currentTarget)[this.type](this.getDelegateOptions()).data('bs.' + this.type)
        
            clearTimeout(self.timeout)
        Severity: Major
        Found in app/scripts/bootstrap.js and 1 other location - About 1 day to fix
        app/scripts/bootstrap.js on lines 1185..1198

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

        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

        define(['angular', '../module'], function(ng) {
          'use strict';
        
          ng
          .module('roles.services')
        Severity: Major
        Found in app/modules/roles/services/RoleService.js and 1 other location - About 6 hrs to fix
        app/modules/roles/services/PermissionService.js on lines 1..31

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

        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

        define(['angular', '../module'], function(ng) {
          'use strict';
        
          ng
          .module('roles.services')
        Severity: Major
        Found in app/modules/roles/services/PermissionService.js and 1 other location - About 6 hrs to fix
        app/modules/roles/services/RoleService.js on lines 1..31

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

        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

              promise
                .then( function() {
                  $rootScope.$broadcast( 'table:reload' );
                  Messenger.success( 'Role ' + $scope.role.name + ' successfully ' + ( !!$scope.role.id ? 'updated.' : 'created.' ) );
                  $modalInstance.close( $scope );
        Severity: Major
        Found in app/modules/roles/controllers/RoleEditController.js and 1 other location - About 6 hrs to fix
        app/modules/roles/controllers/PermissionEditController.js on lines 31..39

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

        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

              promise
                .then( function() {
                  $rootScope.$broadcast( 'table:reload' );
                  Messenger.success( 'Permission ' + $scope.permission.action + ' successfully ' + ( !!$scope.permission.id ? 'updated.' : 'created.' ) );
                  $modalInstance.close( $scope );
        Severity: Major
        Found in app/modules/roles/controllers/PermissionEditController.js and 1 other location - About 6 hrs to fix
        app/modules/roles/controllers/RoleEditController.js on lines 35..43

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

        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

          .factory('UserService', function(UserModel) {
            var UserService = {
              model: UserModel,
        
              data: null,
        Severity: Major
        Found in app/modules/auth/services/UserService.js and 1 other location - About 6 hrs to fix
        app/modules/cs_accounts/services/AccountService.js on lines 6..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 161.

        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

          .factory( 'AccountService', function( AccountModel, UserModel ) {
            var AccountService = {
              model: AccountModel,
        
              data    : null,
        Severity: Major
        Found in app/modules/cs_accounts/services/AccountService.js and 1 other location - About 6 hrs to fix
        app/modules/auth/services/UserService.js on lines 6..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 161.

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

          $.fn.affix = function (option) {
            return this.each(function () {
              var $this   = $(this)
              var data    = $this.data('bs.affix')
              var options = typeof option == 'object' && option
        Severity: Major
        Found in app/scripts/bootstrap.js and 3 other locations - About 4 hrs to fix
        app/scripts/bootstrap.js on lines 1444..1453
        app/scripts/bootstrap.js on lines 1562..1571
        app/scripts/bootstrap.js on lines 1710..1719

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

        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

        define( [ 'angular', '../module' ], function( ng ) {
          'use strict';
        
          /**
           * Angular v1.1.5 still doesn't support ngFocus so we build our own
        Severity: Major
        Found in app/modules/cs_common/directives/NgFocusDirective.js and 1 other location - About 4 hrs to fix
        app/modules/cs_common/directives/NgBlurDirective.js on lines 1..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 127.

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

          $.fn.popover = function (option) {
            return this.each(function () {
              var $this   = $(this)
              var data    = $this.data('bs.popover')
              var options = typeof option == 'object' && option
        Severity: Major
        Found in app/scripts/bootstrap.js and 3 other locations - About 4 hrs to fix
        app/scripts/bootstrap.js on lines 1444..1453
        app/scripts/bootstrap.js on lines 1710..1719
        app/scripts/bootstrap.js on lines 1966..1975

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

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

          $.fn.scrollspy = function (option) {
            return this.each(function () {
              var $this   = $(this)
              var data    = $this.data('bs.scrollspy')
              var options = typeof option == 'object' && option
        Severity: Major
        Found in app/scripts/bootstrap.js and 3 other locations - About 4 hrs to fix
        app/scripts/bootstrap.js on lines 1444..1453
        app/scripts/bootstrap.js on lines 1562..1571
        app/scripts/bootstrap.js on lines 1966..1975

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

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

          $.fn.tooltip = function (option) {
            return this.each(function () {
              var $this   = $(this)
              var data    = $this.data('bs.tooltip')
              var options = typeof option == 'object' && option
        Severity: Major
        Found in app/scripts/bootstrap.js and 3 other locations - About 4 hrs to fix
        app/scripts/bootstrap.js on lines 1562..1571
        app/scripts/bootstrap.js on lines 1710..1719
        app/scripts/bootstrap.js on lines 1966..1975

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

        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

        define( [ 'angular', '../module' ], function( ng ) {
          'use strict';
        
          /**
           * Angular v1.1.5 still doesn't support ngBlur so we build our own
        Severity: Major
        Found in app/modules/cs_common/directives/NgBlurDirective.js and 1 other location - About 4 hrs to fix
        app/modules/cs_common/directives/NgFocusDirective.js on lines 1..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 127.

        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

            $scope.columns = [
              {
                name       : 'id',
                title      : 'ID',
                glyph      : 'slack',
        Severity: Major
        Found in app/modules/roles/controllers/PermissionListController.js and 1 other location - About 4 hrs to fix
        app/modules/roles/controllers/RoleListController.js on lines 14..42

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

        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

        Severity
        Category
        Status
        Source
        Language