CleverStack/angular-seed

View on GitHub

Showing 114 of 114 total issues

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

File SessionProvider.js has 338 lines of code (exceeds 250 allowed). Consider refactoring.
Open

define( [ 'angular', '../module' ], function( ng ) {
  'use strict';

  /**
   * @ngdoc service
Severity: Minor
Found in app/modules/auth/providers/SessionProvider.js - About 4 hrs to fix

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

    define(['angular', '../module'], function(ng) {
      'use strict';
    
      ng
      .module('roles.models')
    Severity: Major
    Found in app/modules/roles/models/RoleModel.js and 1 other location - About 3 hrs to fix
    app/modules/roles/models/PermissionModel.js on lines 1..17

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

    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.models')
    Severity: Major
    Found in app/modules/roles/models/PermissionModel.js and 1 other location - About 3 hrs to fix
    app/modules/roles/models/RoleModel.js on lines 1..17

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

    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

      $.fn.dropdown = function (option) {
        return this.each(function () {
          var $this = $(this)
          var data  = $this.data('bs.dropdown')
    
    
    Severity: Major
    Found in app/scripts/bootstrap.js and 1 other location - About 3 hrs to fix
    app/scripts/bootstrap.js on lines 136..144

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

    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

      $.fn.alert = function (option) {
        return this.each(function () {
          var $this = $(this)
          var data  = $this.data('bs.alert')
    
    
    Severity: Major
    Found in app/scripts/bootstrap.js and 1 other location - About 3 hrs to fix
    app/scripts/bootstrap.js on lines 801..809

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

    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

      coverageE2E: {
        options: {
          port:         '<%= appConfig.test.e2e.coverage.port %>',
          middleware:   function( connect ) {
            return [
    Severity: Major
    Found in tasks/grunt/connect.js and 2 other locations - About 3 hrs to fix
    tasks/grunt/connect.js on lines 59..71
    tasks/grunt/connect.js on lines 72..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 111.

    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

      coverageE2EReport: {
        options: {
          port:         '<%= appConfig.test.e2e.report.port %>',
          middleware:   function( connect ) {
            return [
    Severity: Major
    Found in tasks/grunt/connect.js and 2 other locations - About 3 hrs to fix
    tasks/grunt/connect.js on lines 46..58
    tasks/grunt/connect.js on lines 72..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 111.

    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

      coverageE2EReportNoWait: {
        options: {
          port:         '<%= appConfig.test.e2e.report.port %>',
          middleware:   function( connect ) {
            return [
    Severity: Major
    Found in tasks/grunt/connect.js and 2 other locations - About 3 hrs to fix
    tasks/grunt/connect.js on lines 46..58
    tasks/grunt/connect.js on lines 59..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 111.

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

          link: function ($scope, element) {
    
            var alertClass, appMessage, alertType, icon, textWrapper, closeButton, closingPromise;
            var allowedTypes = ['warning', 'error', 'success', 'info', 'loading'];
            var defaultType = 'warning';
    Severity: Major
    Found in app/modules/cs_messenger/scripts/messenger_directive.js - About 3 hrs to fix

      Function Helpers has 67 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          function  Helpers() {
      
            var helpers = {};
            var inheritedProviders = [];
      
      
      Severity: Major
      Found in app/modules/cs_common/providers/HelpersProvider.js - About 2 hrs to fix

        Function locationChange has 59 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                  handlers.locationChange = handlers.locationChange || function( event, next ) {
                    next = '/' + next.split( '/' ).splice( 3 ).join( '/' ).split( '?' )[ 0 ];
                    if( next.length > 1 && next.substr(-1) === '/' ){
                      next = next.substr(0, next.length - 1);
                    }
        Severity: Major
        Found in app/modules/auth/providers/SessionProvider.js - About 2 hrs to fix

          Function open has 58 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  modals.open = function ( obj, index, template, options, action ) {
                    if (arguments.length < 5) {
                      action   = options;
                      options  = template;
                      template = index;
          Severity: Major
          Found in app/modules/cs_modal/scripts/cs_modal_factory.js - About 2 hrs to fix

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

                  $get: function( $injector, UserService ) {
                    var RoleService   = $injector.has( 'RoleService' ) ? $injector.get( 'RoleService' ) : false
                      , ModalFactory  = $injector.has( 'ModalFactory' ) ? $injector.get( 'ModalFactory' ) : false;
            
                    if ( inheritedProviders ) {
            Severity: Major
            Found in app/modules/auth/providers/AuthHelpersProvider.js - About 2 hrs to fix

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

                    $get: function( $injector, $rootScope, $log, Session, Helpers ) {
                      if ( !sessionProvider ) {
                        sessionProvider = Session;
                      }
              
              
              Severity: Major
              Found in app/modules/cs_accounts/providers/AccountProvider.js - About 2 hrs to fix

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

                                if ( typeof role === 'object' ) {
                                  role.Users        = role.Users.map( function( user ) {
                                    return user.id;
                                  });
                                  role.Permissions  = role.Permissions.map( function( permission ) {
                Severity: Major
                Found in app/modules/roles/providers/RoleHelpersProvider.js and 1 other location - About 2 hrs to fix
                app/modules/roles/providers/RoleHelpersProvider.js on lines 35..45

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

                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( role ) {
                
                                      role.Users        = role.Users.map( function( user ) {
                                        return user.id;
                                      });
                Severity: Major
                Found in app/modules/roles/providers/RoleHelpersProvider.js and 1 other location - About 2 hrs to fix
                app/modules/roles/providers/RoleHelpersProvider.js on lines 23..32

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

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

                          function( $injector, $location, $log ) {
                
                            if ( inheritedProviders ) {
                              inheritedProviders.forEach( function( inheritedProvider ) {
                                var provider = $injector.get( inheritedProvider );
                Severity: Major
                Found in app/modules/cs_common/providers/HelpersProvider.js - About 2 hrs to fix

                  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/auth/providers/AuthHelpersProvider.js and 1 other location - About 2 hrs to fix
                  app/modules/cs_common/providers/HelpersProvider.js on lines 20..28

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

                          helpers.openRoleModal = function( role ) {
                            ModalFactory.open( role, '/modules/roles/views/role/form.html', {
                              controller: 'RoleEditController',
                              resolve: {
                                role: function() {
                  Severity: Minor
                  Found in app/modules/roles/providers/RoleHelpersProvider.js - About 2 hrs to fix
                    Severity
                    Category
                    Status
                    Source
                    Language