iamisti/mdDataTable

View on GitHub

Showing 77 of 77 total issues

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

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

            link: function($scope, element, attrs, ctrl, transclude){
                $scope.dataStorage = ctrl.dataStorage;

                _injectContentIntoTemplate();

Severity: Minor
Found in app/modules/main/directives/mdtTableDirective.js - About 1 hr to fix

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

            TableDataStorageService.prototype.getRowOptions = function(index){
                if(!this.storage[index]){
                    $log.error('row is not exists at index: '+index);
                    return;
                }
    Severity: Major
    Found in app/modules/main/factories/TableDataStorageFactory.js and 1 other location - About 1 hr to fix
    app/modules/main/factories/TableDataStorageFactory.js on lines 34..41

    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

            TableDataStorageService.prototype.getRowData = function(index){
                if(!this.storage[index]){
                    $log.error('row is not exists at index: '+index);
                    return;
                }
    Severity: Major
    Found in app/modules/main/factories/TableDataStorageFactory.js and 1 other location - About 1 hr to fix
    app/modules/main/factories/TableDataStorageFactory.js on lines 43..50

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

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

      Function PaginationFeature has 36 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          function PaginationFeature(mdtPaginationHelperFactory, mdtAjaxPaginationHelperFactory){
              var service = this;
      
              service.initFeature = initFeature;
              service.startFeature = startFeature;
      Severity: Minor
      Found in app/modules/main/features/PaginationFeature.js - About 1 hr to fix

        Function EditCellFeature has 36 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            function EditCellFeature($mdDialog){
        
                var service = this;
        
                service.addRequiredFunctions = function($scope, ctrl){
        Severity: Minor
        Found in app/modules/main/features/EditCellFeature/EditCellFeature.js - About 1 hr to fix

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

              function mdtChipsColumnFilterDirective(_, $timeout, ColumnFilterFeature, ColumnSortFeature){
                  return{
                      restrict: 'E',
                      templateUrl: '/main/templates/mdtChipsColumnFilter.html',
                      scope: {

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

                    service.addRequiredFunctions = function($scope, ctrl){
            
                        $scope.saveRow = function(rowData){
                            var rawRowData = ctrl.dataStorage.getSavedRowData(rowData);
            
            
            Severity: Minor
            Found in app/modules/main/features/EditCellFeature/EditCellFeature.js - About 1 hr to fix

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

                  function mdtColumnDirective($interpolate, ColumnFilterFeature, ColumnSortFeature, ColumnSelectorFeature){
                      return {
                          restrict: 'E',
                          transclude: true,
                          replace: true,
              Severity: Minor
              Found in app/modules/main/directives/header/mdtColumnDirective.js - About 1 hr to fix

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

                        function initFeature(scope, ctrl){
                            if(!scope.mdtRowPaginator){
                                ctrl.mdtPaginationHelper = scope.mdtPaginationHelper = mdtPaginationHelperFactory
                                    .getInstance(ctrl.dataStorage, scope.paginatedRows, scope.mdtRow);
                            }else{
                Severity: Minor
                Found in app/modules/main/features/PaginationFeature.js - About 1 hr to fix

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

                      function mdtAddHtmlContentToCellDirective($parse, $compile, $rootScope){
                          return {
                              restrict: 'A',
                              require: '^?mdtTable',
                              link: function($scope, element, attr, ctrl){

                    Function _injectContentIntoTemplate has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                                    function _injectContentIntoTemplate(){
                                        transclude(function (clone) {
                                            var headings = [];
                                            var body = [];
                                            var customCell = [];
                    Severity: Minor
                    Found in app/modules/main/directives/mdtTableDirective.js - About 1 hr to fix

                      Function showEditDialog has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                                  $scope.showEditDialog = function(ev, cellData, rowData){
                                      var rect = ev.currentTarget.closest('td').getBoundingClientRect();
                                      var position = {
                                          top: rect.top,
                                          left: rect.left
                      Severity: Minor
                      Found in app/modules/main/features/EditCellFeature/EditCellFeature.js - About 1 hr to fix

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

                        (function(){
                            'use strict';
                        
                            /**
                             * @name ColumnSortDirectionProvider
                        app/modules/main/providers/PaginatorTypeProvider.js on lines 1..18

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

                        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

                        (function(){
                            'use strict';
                        
                            /**
                             * @name PaginatorTypeProvider
                        Severity: Major
                        Found in app/modules/main/providers/PaginatorTypeProvider.js and 1 other location - About 1 hr to fix
                        app/modules/main/features/ColumnSortFeature/providers/ColumnSortDirection.js on lines 1..18

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

                        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

                                        $scope.headerRowData.columnFilter.valuesProviderCallback().then(function(values){
                                            if(values){
                                                $scope.selectableItems = values;
                                            }
                                        });
                        app/modules/main/features/ColumnFilterFeature/directives/mdtCheckboxColumnFilterDirective.js on lines 34..38

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

                        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

                                        $scope.headerRowData.columnFilter.valuesProviderCallback().then(function(values){
                                            if(values){
                                                $scope.selectableItems = values
                                            }
                                        });
                        app/modules/main/features/ColumnFilterFeature/directives/mdtDropdownColumnFilterDirective.js on lines 38..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 52.

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

                                        function transformChip(chip) {
                                            if($scope.headerRowData.columnFilter.valuesTransformerCallback){
                                                return $scope.headerRowData.columnFilter.valuesTransformerCallback(chip);
                                            }
                        
                        
                        app/modules/main/features/ColumnFilterFeature/directives/mdtChipsColumnFilterDirective.js on lines 40..46
                        app/modules/main/features/ColumnFilterFeature/directives/mdtDropdownColumnFilterDirective.js on lines 44..50

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

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

                                        function transformChip(chip) {
                                            if($scope.headerRowData.columnFilter.valuesTransformerCallback){
                                                return $scope.headerRowData.columnFilter.valuesTransformerCallback(chip);
                                            }
                        
                        
                        app/modules/main/features/ColumnFilterFeature/directives/mdtCheckboxColumnFilterDirective.js on lines 73..79
                        app/modules/main/features/ColumnFilterFeature/directives/mdtChipsColumnFilterDirective.js on lines 40..46

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

                        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