Strider-CD/strider

View on GitHub
clients/classic-ui/public/libs/ui-bootstrap.js

Summary

Maintainability
F
2 mos
Test Coverage

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

angular.module('ui.bootstrap', ['ui.bootstrap.buttons','ui.bootstrap.position','ui.bootstrap.datepicker','ui.bootstrap.pagination','ui.bootstrap.rating','ui.bootstrap.timepicker','ui.bootstrap.bindHtml','ui.bootstrap.typeahead']);
angular.module('ui.bootstrap.buttons', [])

  .constant('buttonConfig', {
    activeClass:'active',
Severity: Major
Found in clients/classic-ui/public/libs/ui-bootstrap.js - About 3 days to fix

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

          link: function (scope, element, attrs, ngModel) {
            if ( !ngModel ) {
              return; // do nothing if no ng-model
            }
    
    
    Severity: Major
    Found in clients/classic-ui/public/libs/ui-bootstrap.js - About 6 hrs to fix

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

              link:function (originalScope, element, attrs, modelCtrl) {
      
                //SUPPORTED ATTRIBUTES (OPTIONS)
      
                //minimal no of characters that needs to be entered before typeahead kicks-in
      Severity: Major
      Found in clients/classic-ui/public/libs/ui-bootstrap.js - About 5 hrs to fix

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

                link: function (originalScope, element, attrs, ngModel) {
        
                  var closeOnDateSelection = angular.isDefined(attrs.closeOnDateSelection) ? scope.$eval(attrs.closeOnDateSelection) : datepickerPopupConfig.closeOnDateSelection;
                  var dateFormat = attrs.datepickerPopup || datepickerPopupConfig.dateFormat;
        
        
        Severity: Major
        Found in clients/classic-ui/public/libs/ui-bootstrap.js - About 5 hrs to fix

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

                link: function (scope, element, attrs, ctrls) {
                  var datepickerCtrl = ctrls[0], ngModel = ctrls[1];
          
                  if (!ngModel) {
                    return; // do nothing if no ng-model
          Severity: Major
          Found in clients/classic-ui/public/libs/ui-bootstrap.js - About 3 hrs to fix

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

                  link: function (scope, element, attrs, paginationCtrl) {
            
                  // Setup configuration parameters
                    var maxSize,
                      boundaryLinks  = paginationCtrl.getAttributeValue(attrs.boundaryLinks,  config.boundaryLinks      ),
            Severity: Major
            Found in clients/classic-ui/public/libs/ui-bootstrap.js - About 2 hrs to fix

              Function getPages has 43 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      paginationCtrl.getPages = function (currentPage, totalPages) {
                        var pages = [];
              
                        // Default page limits
                        var startPage = 1, endPage = totalPages;
              Severity: Minor
              Found in clients/classic-ui/public/libs/ui-bootstrap.js - About 1 hr to fix

                Function getMatchesAsync has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                          var getMatchesAsync = function (inputValue) {
                
                            var locals = {$viewValue: inputValue};
                            isLoadingSetter(originalScope, true);
                            $q.when(parserResult.source(scope, locals)).then(function (matches) {
                Severity: Minor
                Found in clients/classic-ui/public/libs/ui-bootstrap.js - About 1 hr to fix

                  Function makePage has 5 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                          function makePage(number, text, isDisabled, isPrevious, isNext) {
                  Severity: Minor
                  Found in clients/classic-ui/public/libs/ui-bootstrap.js - About 35 mins to fix

                    Avoid too many return statements within this function.
                    Open

                                  return undefined;
                    Severity: Major
                    Found in clients/classic-ui/public/libs/ui-bootstrap.js - About 30 mins to fix

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

                      angular.module('ui.bootstrap.datepicker', ['ui.bootstrap.position'])
                      
                        .constant('datepickerConfig', {
                          dayFormat: 'dd',
                          monthFormat: 'MMMM',
                      Severity: Major
                      Found in clients/classic-ui/public/libs/ui-bootstrap.js and 1 other location - About 3 wks to fix
                      apps/strider/public/libs/ui-bootstrap.js on lines 150..596

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

                      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

                      angular.module('ui.bootstrap.typeahead', ['ui.bootstrap.position', 'ui.bootstrap.bindHtml'])
                      
                      /**
                       * A helper service that can parse typeahead's syntax (string provided by users)
                       * Extracted to a separate service for ease of unit testing
                      Severity: Major
                      Found in clients/classic-ui/public/libs/ui-bootstrap.js and 1 other location - About 2 wks to fix
                      apps/strider/public/libs/ui-bootstrap.js on lines 1166..1493

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

                      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

                      angular.module('ui.bootstrap.timepicker', [])
                      
                        .constant('timepickerConfig', {
                          hourStep: 1,
                          minuteStep: 1,
                      Severity: Major
                      Found in clients/classic-ui/public/libs/ui-bootstrap.js and 1 other location - About 1 wk to fix
                      apps/strider/public/libs/ui-bootstrap.js on lines 923..1154

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

                      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

                      angular.module('ui.bootstrap.pagination', [])
                      
                        .controller('PaginationController', ['$scope', '$attrs', '$parse', '$interpolate', function ($scope, $attrs, $parse, $interpolate) {
                          var self = this;
                      
                      
                      Severity: Major
                      Found in clients/classic-ui/public/libs/ui-bootstrap.js and 1 other location - About 1 wk to fix
                      apps/strider/public/libs/ui-bootstrap.js on lines 598..838

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

                      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

                      angular.module('ui.bootstrap.rating', [])
                      
                        .constant('ratingConfig', {
                          max: 5,
                          stateOn: null,
                      Severity: Major
                      Found in clients/classic-ui/public/libs/ui-bootstrap.js and 1 other location - About 4 days to fix
                      apps/strider/public/libs/ui-bootstrap.js on lines 840..922

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

                      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

                      angular.module('ui.bootstrap.position', [])
                      
                      /**
                       * A set of utility methods that can be use to retrieve position of DOM elements.
                       * It is meant to be used where we need to absolute-position DOM elements in
                      Severity: Major
                      Found in clients/classic-ui/public/libs/ui-bootstrap.js and 1 other location - About 3 days to fix
                      apps/strider/public/libs/ui-bootstrap.js on lines 70..148

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

                      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

                      angular.module('ui.bootstrap.buttons', [])
                      
                        .constant('buttonConfig', {
                          activeClass:'active',
                          toggleEvent:'click'
                      Severity: Major
                      Found in clients/classic-ui/public/libs/ui-bootstrap.js and 1 other location - About 3 days to fix
                      apps/strider/public/libs/ui-bootstrap.js on lines 2..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 531.

                      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

                      angular.module('ui.bootstrap.bindHtml', [])
                      
                        .directive('bindHtmlUnsafe', function () {
                          return function (scope, element, attr) {
                            element.addClass('ng-binding').data('$binding', attr.bindHtmlUnsafe);
                      Severity: Major
                      Found in clients/classic-ui/public/libs/ui-bootstrap.js and 1 other location - About 3 hrs to fix
                      apps/strider/public/libs/ui-bootstrap.js on lines 1156..1165

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

                      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

                      There are no issues that match your filters.

                      Category
                      Status