timonwong/smart-table-improved

View on GitHub

Showing 29 of 29 total issues

File node.d.ts has 1672 lines of code (exceeds 250 allowed). Consider refactoring.
Open

// Type definitions for Node.js v4.x
// Project: http://nodejs.org/
// Definitions by: Microsoft TypeScript <http://typescriptlang.org>, DefinitelyTyped <https://github.com/borisyankov/DefinitelyTyped>
// Definitions: https://github.com/borisyankov/DefinitelyTyped

Severity: Major
Found in typings/node/node.d.ts - About 4 days to fix

    File angular.d.ts has 721 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    // Type definitions for Angular JS 1.4+
    // Project: http://angularjs.org
    // Definitions by: Diego Vilar <http://github.com/diegovilar>
    // Definitions: https://github.com/borisyankov/DefinitelyTyped
    
    
    Severity: Major
    Found in typings/angularjs/angular.d.ts - About 1 day to fix

      File jquery.d.ts has 594 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      // Type definitions for jQuery 1.10.x / 2.0.x
      // Project: http://jquery.com/
      // Definitions by: Boris Yankov <https://github.com/borisyankov/>, Christian Hoffmeister <https://github.com/choffmeister>, Steve Fenton <https://github.com/Steve-Fenton>, Diullei Gomes <https://github.com/Diullei>, Tass Iliopoulos <https://github.com/tasoili>, Jason Swearingen <https://github.com/jasons-novaleaf>, Sean Hill <https://github.com/seanski>, Guus Goossens <https://github.com/Guuz>, Kelly Summerlin <https://github.com/ksummerlin>, Basarat Ali Syed <https://github.com/basarat>, Nicholas Wolverson <https://github.com/nwolverson>, Derek Cicerone <https://github.com/derekcicerone>, Andrew Gaspar <https://github.com/AndrewGaspar>, James Harrison Fisher <https://github.com/jameshfisher>, Seikichi Kondo <https://github.com/seikichi>, Benjamin Jackman <https://github.com/benjaminjackman>, Poul Sorensen <https://github.com/s093294>, Josh Strobl <https://github.com/JoshStrobl>, John Reilly <https://github.com/johnnyreilly/>, Dick van den Brink <https://github.com/DickvdBrink>
      // Definitions: https://github.com/borisyankov/DefinitelyTyped
      
      
      Severity: Major
      Found in typings/jquery/jquery.d.ts - About 1 day to fix

        Function stiPagination has a Cognitive Complexity of 46 (exceeds 5 allowed). Consider refactoring.
        Open

        function stiPagination(stiPaginationConfig) {
          return {
            restrict: 'EA',
            require: '^stTable',
            scope: {
        Severity: Minor
        Found in src/sti-pagination.js - About 7 hrs to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

        File jasmine.d.ts has 375 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        // Type definitions for Jasmine 2.2
        // Project: http://jasmine.github.io/
        // Definitions by: Boris Yankov <https://github.com/borisyankov/>, Theodore Brown <https://github.com/theodorejb>, David Pärsson <https://github.com/davidparsson/>
        // Definitions: https://github.com/borisyankov/DefinitelyTyped
        
        
        Severity: Minor
        Found in typings/jasmine/jasmine.d.ts - About 5 hrs to fix

          Function stiPagination has 110 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function stiPagination(stiPaginationConfig) {
            return {
              restrict: 'EA',
              require: '^stTable',
              scope: {
          Severity: Major
          Found in src/sti-pagination.js - About 4 hrs to fix

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

              function link(scope, element, attrs, ctrl) {
                scope.itemsPerPage = scope.itemsPerPage ? scope.itemsPerPage : stiPaginationConfig.itemsPerPage;
                scope.maxSize = scope.maxSize ? scope.maxSize : stiPaginationConfig.maxSize;
            
                scope.autoHide = angular.isDefined(scope.autoHide) ? scope.autoHide : false;
            Severity: Minor
            Found in src/sti-pagination.js - About 1 hr to fix

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

              function StiTableController($scope) {
                let ctrl = this;
              
                $scope.$stiSelected = {};
                $scope.$stiNumSelected = 0;
              Severity: Minor
              Found in src/sti-table.js - About 1 hr to fix

                Function stiTable has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function stiTable($parse) {
                  return {
                    restrict: 'A',
                    require: ['stTable', 'stiTable'],
                    scope: true,
                Severity: Minor
                Found in src/sti-table.js - About 1 hr to fix

                  Function stiTable has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                  Open

                  function stiTable($parse) {
                    return {
                      restrict: 'A',
                      require: ['stTable', 'stiTable'],
                      scope: true,
                  Severity: Minor
                  Found in src/sti-table.js - About 1 hr to fix

                  Cognitive Complexity

                  Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                  A method's cognitive complexity is based on a few simple rules:

                  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                  • Code is considered more complex for each "break in the linear flow of the code"
                  • Code is considered more complex when "flow breaking structures are nested"

                  Further reading

                  Function stiSelectAll has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function stiSelectAll() {
                    return {
                      restrict: 'A',
                      require: [
                        '^stiTable',
                  Severity: Minor
                  Found in src/sti-select-all.js - About 1 hr to fix

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

                    function writeTemplates() {
                      return new Promise(function (resolve, reject) {
                        glob('template/**/*.html', function (err, files) {
                          if (err) {
                            reject(err);
                    Severity: Minor
                    Found in build/build.js - About 1 hr to fix

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

                        function link(scope, element, attrs, ctrls) {
                          let [stTableCtrl, stiTableCtrl] = ctrls;
                      
                          scope.$stiRowIdField = angular.isDefined(attrs.rowIdField) ? attrs.rowIdField : '$$hashKey';
                          if (attrs.trackSelectedMode === 'all') {
                      Severity: Minor
                      Found in src/sti-table.js - About 1 hr to fix

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

                            scope.directionLinks = angular.isDefined(attrs.directionLinks) ? scope.$parent.$eval(attrs.directionLinks) : true;
                        Severity: Minor
                        Found in src/sti-pagination.js and 1 other location - About 30 mins to fix
                        src/sti-pagination.js on lines 36..36

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

                        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

                        Avoid too many return statements within this function.
                        Open

                              return i;
                        Severity: Major
                        Found in src/sti-pagination.js - About 30 mins to fix

                          Avoid too many return statements within this function.
                          Open

                                  return i;
                          Severity: Major
                          Found in src/sti-pagination.js - About 30 mins to fix

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

                                scope.boundaryLinks = angular.isDefined(attrs.boundaryLinks) ? scope.$parent.$eval(attrs.boundaryLinks) : false;
                            Severity: Minor
                            Found in src/sti-pagination.js and 1 other location - About 30 mins to fix
                            src/sti-pagination.js on lines 35..35

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

                            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 StiTableController has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                            Open

                            function StiTableController($scope) {
                              let ctrl = this;
                            
                              $scope.$stiSelected = {};
                              $scope.$stiNumSelected = 0;
                            Severity: Minor
                            Found in src/sti-table.js - About 25 mins to fix

                            Cognitive Complexity

                            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                            A method's cognitive complexity is based on a few simple rules:

                            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                            • Code is considered more complex for each "break in the linear flow of the code"
                            • Code is considered more complex when "flow breaking structures are nested"

                            Further reading

                            Parsing error: 'import' and 'export' may appear only with 'sourceType: module'
                            Open

                            import * as angular from 'angular';
                            Severity: Minor
                            Found in src/sti-select-all.js by eslint

                            For more information visit Source: http://eslint.org/docs/rules/

                            Parsing error: 'import' and 'export' may appear only with 'sourceType: module'
                            Open

                            import './sti-modules';
                            Severity: Minor
                            Found in src/index.js by eslint

                            For more information visit Source: http://eslint.org/docs/rules/

                            Severity
                            Category
                            Status
                            Source
                            Language