iamisti/mdDataTable

View on GitHub

Showing 77 of 77 total issues

Function mdtAjaxPaginationHelperFactory has 123 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    function mdtAjaxPaginationHelperFactory(ColumnFilterFeature, ColumnSortFeature, PaginatorTypeProvider, _){

        function mdtAjaxPaginationHelper(params){
            this.paginatorType = PaginatorTypeProvider.AJAX;

Severity: Major
Found in app/modules/main/factories/mdtAjaxPaginationHelperFactory.js - About 4 hrs to fix

    Function mdtTableDirective has 122 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        function mdtTableDirective(TableDataStorageFactory,
                                   EditCellFeature,
                                   SelectableRowsFeature,
                                   PaginationFeature,
                                   ColumnSelectorFeature,
    Severity: Major
    Found in app/modules/main/directives/mdtTableDirective.js - About 4 hrs to fix

      Function TableDataStorageFactory has 103 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          function TableDataStorageFactory($log, _){
      
              function TableDataStorageService(){
                  this.storage = [];
                  this.header = [];
      Severity: Major
      Found in app/modules/main/factories/TableDataStorageFactory.js - About 4 hrs to fix

        Function ColumnSortFeature has 102 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            function ColumnSortFeature(ColumnSortDirectionProvider) {
        
                var service = this;
        
                /**
        Severity: Major
        Found in app/modules/main/features/ColumnSortFeature/ColumnSortFeature.js - About 4 hrs to fix

          Function ColumnFilterFeature has 89 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              function ColumnFilterFeature(ColumnSortFeature, PaginatorTypeProvider){
          
                  var service = this;
          
                  /**
          Severity: Major
          Found in app/modules/main/features/ColumnFilterFeature/ColumnFilterFeature.js - About 3 hrs to fix

            Function mdtColumnSelectorDirective has 83 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                function mdtColumnSelectorDirective(ColumnSelectorFeature, ColumnFilterFeature, PaginatorTypeProvider){
                    return{
                        restrict: 'E',
                        templateUrl: '/main/templates/mdtColumnSelector.html',
                        scope: true,

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

                          if(headerRowData.columnSort.sort === false){
                              headerRowData.columnSort.sort = ColumnSortDirectionProvider.ASC;
                          }else if(headerRowData.columnSort.sort === ColumnSortDirectionProvider.ASC){
                              headerRowData.columnSort.sort = ColumnSortDirectionProvider.DESC;
                          }else{
              app/modules/main/features/ColumnSortFeature/ColumnSortFeature.js on lines 118..124

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

              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(sortingData.columnSort.sort == false){
                              sortingData.columnSort.sort = ColumnSortDirectionProvider.ASC;
                          }else if(sortingData.columnSort.sort === ColumnSortDirectionProvider.ASC){
                              sortingData.columnSort.sort = ColumnSortDirectionProvider.DESC;
                          }else{
              app/modules/main/features/ColumnSortFeature/ColumnSortFeature.js on lines 137..143

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

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

                          link: function($scope, element){
                              ColumnSelectorFeature.positionElement(element);
              
                              $scope.headerRowsData = _.map($scope.dataStorage.header, function(item){
                                  //excluded content should also be in, since we use the index of the array to apply the changes. Do not exclude them.

                Function mdtPaginationHelperFactory has 66 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    function mdtPaginationHelperFactory(PaginatorTypeProvider, _){
                
                        function mdtPaginationHelper(dataStorage, paginationSetting){
                            this.paginatorType = PaginatorTypeProvider.ARRAY;
                
                
                Severity: Major
                Found in app/modules/main/factories/mdtPaginationHelperFactory.js - About 2 hrs to fix

                  Function mdtCheckboxColumnFilterDirective has 60 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      function mdtCheckboxColumnFilterDirective(_, ColumnFilterFeature, ColumnSortFeature, ColumnSortDirectionProvider){
                          return{
                              restrict: 'E',
                              templateUrl: '/main/templates/mdtCheckboxColumnFilter.html',
                              scope: {

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

                            mdtAjaxPaginationHelper.prototype.previousPage = function(){
                                var that = this;
                                if(this.hasPreviousPage()){
                                    this.fetchPage(this.page-1).then(function(){
                                        that.page--;
                    Severity: Major
                    Found in app/modules/main/factories/mdtAjaxPaginationHelperFactory.js and 1 other location - About 2 hrs to fix
                    app/modules/main/factories/mdtAjaxPaginationHelperFactory.js on lines 74..81

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

                    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

                            mdtAjaxPaginationHelper.prototype.nextPage = function(){
                                var that = this;
                                if(this.hasNextPage()){
                                    this.fetchPage(this.page+1).then(function(){
                                        that.page++;
                    Severity: Major
                    Found in app/modules/main/factories/mdtAjaxPaginationHelperFactory.js and 1 other location - About 2 hrs to fix
                    app/modules/main/factories/mdtAjaxPaginationHelperFactory.js on lines 65..72

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

                    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.isAllSelected = function(){
                                        var result = _.find($scope.headerRowsData, function(item){
                                            if(item.isExcluded){
                                                return false;
                                            }
                    app/modules/main/features/ColumnSelectorFeature/directives/mdtColumnSelectorDirective.js on lines 71..81

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

                    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.isNothingSelected = function(){
                                        var result = _.find($scope.headerRowsData, function(item){
                                            if(item.isExcluded){
                                                return false;
                                            }
                    app/modules/main/features/ColumnSelectorFeature/directives/mdtColumnSelectorDirective.js on lines 59..69

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

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

                                controller: function mdtTable($scope){
                                    var vm = this;
                    
                                    $scope.rippleEffectCallback = function(){
                                        return $scope.rippleEffect ? $scope.rippleEffect : false;
                    Severity: Minor
                    Found in app/modules/main/directives/mdtTableDirective.js - About 2 hrs to fix

                      Function link has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                                  link: function($scope, element){
                                      ColumnFilterFeature.positionColumnFilterBox(element);
                      
                                      $scope.transformChip = transformChip;
                                      $scope.selectableItems = [];

                        Function ColumnSelectorFeature has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            function ColumnSelectorFeature() {
                        
                                var service = this;
                        
                                /**

                          Function mdtDropdownColumnFilterDirective has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              function mdtDropdownColumnFilterDirective(ColumnFilterFeature, ColumnSortFeature){
                                  return{
                                      restrict: 'E',
                                      templateUrl: '/main/templates/mdtDropdownColumnFilter.html',
                                      scope: {

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

                                            $scope.clearAll = function($event){
                                                $event.preventDefault();
                            
                                                _.each($scope.headerRowsData, function(item){
                                                    if(item.isExcluded){
                            app/modules/main/features/ColumnSelectorFeature/directives/mdtColumnSelectorDirective.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 72.

                            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