luyadev/luya-module-admin

View on GitHub
src/resources/vendorlibs/angularjs-datepicker/angular-datepicker.js

Summary

Maintainability
F
1 mo
Test Coverage

Function withAngular has a Cognitive Complexity of 438 (exceeds 5 allowed). Consider refactoring.
Open

(function withAngular(angular, navigator) {

  'use strict';

  var A_DAY_IN_MILLISECONDS = 86400000
Severity: Minor
Found in src/resources/vendorlibs/angularjs-datepicker/angular-datepicker.js - About 1 wk 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 withAngular has 786 lines of code (exceeds 25 allowed). Consider refactoring.
Open

(function withAngular(angular, navigator) {

  'use strict';

  var A_DAY_IN_MILLISECONDS = 86400000
Severity: Major
Found in src/resources/vendorlibs/angularjs-datepicker/angular-datepicker.js - About 3 days to fix

    Function datepickerDirective has 658 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        , datepickerDirective = function datepickerDirective($window, $compile, $locale, $filter, $interpolate, $timeout) {
    
          var linkingFunction = function linkingFunction($scope, element, attr) {
    
            $scope.today = new Date();
    Severity: Major
    Found in src/resources/vendorlibs/angularjs-datepicker/angular-datepicker.js - About 3 days to fix

      Function linkingFunction has 633 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

            var linkingFunction = function linkingFunction($scope, element, attr) {
      
              $scope.today = new Date();
      
              //get child input
      Severity: Major
      Found in src/resources/vendorlibs/angularjs-datepicker/angular-datepicker.js - About 3 days to fix

        File angular-datepicker.js has 789 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        /*global angular document navigator*/
        (function withAngular(angular, navigator) {
        
          'use strict';
        
        
        Severity: Major
        Found in src/resources/vendorlibs/angularjs-datepicker/angular-datepicker.js - About 1 day to fix

          Function paginateYears has 71 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  $scope.paginateYears = function paginateYears(startingYear) {
                    var i
                     , theNewYears = []
                     , daysToPrepend = 10
                     , daysToAppend = 10;
          Severity: Major
          Found in src/resources/vendorlibs/angularjs-datepicker/angular-datepicker.js - About 2 hrs to fix

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

                , generateMonthAndYearHeader = function generateMonthAndYearHeader(prevButton, nextButton, preventMobile) {
            
                  if (preventMobile) {
            
                    isMobile = false;
            Severity: Minor
            Found in src/resources/vendorlibs/angularjs-datepicker/angular-datepicker.js - About 1 hr to fix

              Function localDateTimestamp has 45 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                        , localDateTimestamp = function localDateTimestamp(rawDate, dateFormatDefinition) {
                          
                          var formattingTokens = /(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|MMMM|MMM|MM|M|dd?d?|yy?yy?y?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g
                          ,formatDate,dateSplit, m, d, y, index, el, longName, shortName;
              
              
              Severity: Minor
              Found in src/resources/vendorlibs/angularjs-datepicker/angular-datepicker.js - About 1 hr to fix

                Function setDaysInMonth has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                          , setDaysInMonth = function setDaysInMonth(month, year) {
                
                            var i
                              , limitDate = new Date(year, month, 0).getDate()
                              , firstDayMonthNumber = new Date(year + '/' + month + '/' + 1).getDay()
                Severity: Minor
                Found in src/resources/vendorlibs/angularjs-datepicker/angular-datepicker.js - About 1 hr to fix

                  Consider simplifying this complex logical expression.
                  Open

                        if (navigator.userAgent &&
                          (navigator.userAgent.match(/Android/i) ||
                          navigator.userAgent.match(/webOS/i) ||
                          navigator.userAgent.match(/iPhone/i) ||
                          navigator.userAgent.match(/iPad/i) ||
                  Severity: Critical
                  Found in src/resources/vendorlibs/angularjs-datepicker/angular-datepicker.js - About 1 hr to fix

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

                              , showCalendar = function showCalendar() {
                                //lets hide all the latest instances of datepicker
                                pageDatepickers = $window.document.getElementsByClassName('_720kb-datepicker-calendar');
                    
                                angular.forEach(pageDatepickers, function forEachDatepickerPages(value, key) {
                    Severity: Minor
                    Found in src/resources/vendorlibs/angularjs-datepicker/angular-datepicker.js - About 1 hr to fix

                      Function onTyping has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                                  thisInput.on('keyup blur', function onTyping() {
                      
                                    if (thisInput[0].value &&
                                      thisInput[0].value.length &&
                                      thisInput[0].value.length > 0) {
                      Severity: Minor
                      Found in src/resources/vendorlibs/angularjs-datepicker/angular-datepicker.js - About 1 hr to fix

                        Consider simplifying this complex logical expression.
                        Open

                                          if (date.getFullYear() &&
                                           !isNaN(date.getDay()) &&
                                           !isNaN(date.getMonth()) &&
                                           $scope.isSelectableDay(date.getMonth(), date.getFullYear(), date.getDay()) &&
                                           $scope.isSelectableDate(date.getMonth(), date.getFullYear(), date.getDay()) &&
                        Severity: Major
                        Found in src/resources/vendorlibs/angularjs-datepicker/angular-datepicker.js - About 1 hr to fix

                          Function datepickerDirective has 6 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                              , datepickerDirective = function datepickerDirective($window, $compile, $locale, $filter, $interpolate, $timeout) {
                          Severity: Minor
                          Found in src/resources/vendorlibs/angularjs-datepicker/angular-datepicker.js - About 45 mins to fix

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

                                      , resetToMinDate = function resetToMinDate() {
                            
                                        $scope.month = $filter('date')(new Date($scope.dateMinLimit), 'MMMM');
                                        $scope.monthNumber = Number($filter('date')(new Date($scope.dateMinLimit), 'MM'));
                                        $scope.day = Number($filter('date')(new Date($scope.dateMinLimit), 'dd'));
                            src/resources/vendorlibs/angularjs-datepicker/angular-datepicker.js on lines 265..273

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

                            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

                                      , resetToMaxDate = function resetToMaxDate() {
                            
                                        $scope.month = $filter('date')(new Date($scope.dateMaxLimit), 'MMMM');
                                        $scope.monthNumber = Number($filter('date')(new Date($scope.dateMaxLimit), 'MM'));
                                        $scope.day = Number($filter('date')(new Date($scope.dateMaxLimit), 'dd'));
                            src/resources/vendorlibs/angularjs-datepicker/angular-datepicker.js on lines 256..264

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

                            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

                                      , unregisterDateEnabledDatesWatcher = $scope.$watch('dateEnabledDates', function dateEnabledDatesWatcher(newValue) {
                                        if (newValue) {
                                          dateEnabledDates = $scope.$eval(newValue);
                            
                                          if (!$scope.isSelectableDate($scope.monthNumber, $scope.year, $scope.day)) {
                            src/resources/vendorlibs/angularjs-datepicker/angular-datepicker.js on lines 493..503

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

                            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

                                      , unregisterDateDisabledDatesWatcher = $scope.$watch('dateDisabledDates', function dateDisabledDatesWatcher(newValue) {
                                        if (newValue) {
                                          dateDisabledDates = $scope.$eval(newValue);
                            
                                          if (!$scope.isSelectableDate($scope.monthNumber, $scope.year, $scope.day)) {
                            src/resources/vendorlibs/angularjs-datepicker/angular-datepicker.js on lines 504..514

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

                            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.isSelectableMaxDate = function isSelectableMaxDate(aDate) {
                                      //if current date
                                      if (!!$scope.dateMaxLimit &&
                                         !!new Date($scope.dateMaxLimit) &&
                                         new Date(aDate).getTime() > new Date($scope.dateMaxLimit).getTime()) {
                            src/resources/vendorlibs/angularjs-datepicker/angular-datepicker.js on lines 830..840

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

                            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.isSelectableMinDate = function isSelectableMinDate(aDate) {
                                      //if current date
                                      if (!!$scope.dateMinLimit &&
                                         !!new Date($scope.dateMinLimit) &&
                                         new Date(aDate).getTime() < new Date($scope.dateMinLimit).getTime()) {
                            src/resources/vendorlibs/angularjs-datepicker/angular-datepicker.js on lines 842..852

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

                            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

                                        for (i; i <= dateEnabledDates.length; i += 1) {
                            
                                          if (new Date(dateEnabledDates[i]).getTime() === new Date(monthNumber + '/' + day + '/' + year).getTime()) {
                            
                                            return true;
                            src/resources/vendorlibs/angularjs-datepicker/angular-datepicker.js on lines 805..811

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

                            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

                                        for (i; i <= dateDisabledDates.length; i += 1) {
                            
                                          if (new Date(dateDisabledDates[i]).getTime() === new Date(monthNumber + '/' + day + '/' + year).getTime()) {
                            
                                            return false;
                            src/resources/vendorlibs/angularjs-datepicker/angular-datepicker.js on lines 816..822

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

                            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 ($scope.dateMaxLimit &&
                                      !$scope.isSelectableMaxYear($scope.year) ||
                                      !$scope.isSelectableMaxDate($scope.year + '/' + $scope.monthNumber + '/' + $scope.day)) {
                            
                                      resetToMaxDate();
                            src/resources/vendorlibs/angularjs-datepicker/angular-datepicker.js on lines 985..990

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

                            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 ($scope.dateMinLimit &&
                                      !$scope.isSelectableMinYear($scope.year) ||
                                      !$scope.isSelectableMinDate($scope.year + '/' + $scope.monthNumber + '/' + $scope.day)) {
                            
                                      resetToMinDate();
                            src/resources/vendorlibs/angularjs-datepicker/angular-datepicker.js on lines 992..997

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

                            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

                                              if (dateFormat) {
                                                date = localDateTimestamp(thisInput[0].value.toString(), dateFormat);
                                              } else {
                                                date = new Date(thisInput[0].value.toString());
                                              }
                            src/resources/vendorlibs/angularjs-datepicker/angular-datepicker.js on lines 411..415
                            src/resources/vendorlibs/angularjs-datepicker/angular-datepicker.js on lines 449..453

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

                            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

                                          if (dateFormat) {
                                            date = localDateTimestamp(thisInput[0].value.toString(), dateFormat);
                                          } else {
                                            date = new Date(thisInput[0].value.toString());
                                          }
                            src/resources/vendorlibs/angularjs-datepicker/angular-datepicker.js on lines 449..453
                            src/resources/vendorlibs/angularjs-datepicker/angular-datepicker.js on lines 726..730

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

                            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

                                        if (dateFormat) {
                                          date = localDateTimestamp(thisInput[0].value.toString(), dateFormat);
                                        } else {
                                          date = new Date(thisInput[0].value.toString());
                                        }
                            src/resources/vendorlibs/angularjs-datepicker/angular-datepicker.js on lines 411..415
                            src/resources/vendorlibs/angularjs-datepicker/angular-datepicker.js on lines 726..730

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

                            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.isSelectableMinYear = function isSelectableMinYear(year) {
                                      if (!!$scope.dateMinLimit &&
                                        year < new Date($scope.dateMinLimit).getFullYear()) {
                            
                                        return false;
                            src/resources/vendorlibs/angularjs-datepicker/angular-datepicker.js on lines 854..862

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

                            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.isSelectableMaxYear = function isSelectableMaxYear(year) {
                                      if (!!$scope.dateMaxLimit &&
                                        year > new Date($scope.dateMaxLimit).getFullYear()) {
                            
                                        return false;
                            src/resources/vendorlibs/angularjs-datepicker/angular-datepicker.js on lines 864..872

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

                            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 ($scope.monthNumber === 1) {
                            
                                        $scope.monthNumber = 12;
                                        //its happy new year
                                        prevYear();
                            src/resources/vendorlibs/angularjs-datepicker/angular-datepicker.js on lines 518..526

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

                            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 ($scope.monthNumber === 12) {
                            
                                        $scope.monthNumber = 1;
                                        //its happy new year
                                        nextYear();
                            src/resources/vendorlibs/angularjs-datepicker/angular-datepicker.js on lines 594..602

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

                            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.datepickerID = 'datepicker-id-' + new Date().getTime() + (Math.floor(Math.random() * 6) + 8);
                            src/resources/vendorlibs/angularjs-datepicker/angular-datepicker.js on lines 918..918

                            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

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

                                      $scope.datepickerID = 'datepicker-id-' + new Date().getTime() + (Math.floor(Math.random() * 6) + 8);
                            src/resources/vendorlibs/angularjs-datepicker/angular-datepicker.js on lines 926..926

                            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

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

                                            case el.indexOf('d') !== -1: {
                                              d = dateSplit[index - (formatDate.length - dateSplit.length)];
                                              break;
                                            }
                            src/resources/vendorlibs/angularjs-datepicker/angular-datepicker.js on lines 322..325
                            src/resources/vendorlibs/angularjs-datepicker/angular-datepicker.js on lines 326..329

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

                            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

                                            case el.indexOf('M') !== -1: {
                                              m = dateSplit[index - (formatDate.length - dateSplit.length)];
                                              break;
                                            }
                            src/resources/vendorlibs/angularjs-datepicker/angular-datepicker.js on lines 318..321
                            src/resources/vendorlibs/angularjs-datepicker/angular-datepicker.js on lines 326..329

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

                            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

                                            case el.indexOf('y') !== -1: {
                                              y = dateSplit[index - (formatDate.length - dateSplit.length)];
                                              break; 
                                            }
                            src/resources/vendorlibs/angularjs-datepicker/angular-datepicker.js on lines 318..321
                            src/resources/vendorlibs/angularjs-datepicker/angular-datepicker.js on lines 322..325

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

                            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

                                      angular.element(document.getElementsByClassName($scope.datepickerAppendTo.replace('.', ''))[0]).append($compile(angular.element(htmlTemplate))($scope, function afterCompile(el) {
                            
                                        theCalendar = angular.element(el)[0];
                                      }));
                            src/resources/vendorlibs/angularjs-datepicker/angular-datepicker.js on lines 927..930
                            src/resources/vendorlibs/angularjs-datepicker/angular-datepicker.js on lines 934..937

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

                            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

                                      angular.element(document).find('body').append($compile(angular.element(htmlTemplate))($scope, function afterCompile(el) {
                            
                                        theCalendar = angular.element(el)[0];
                                      }));
                            src/resources/vendorlibs/angularjs-datepicker/angular-datepicker.js on lines 919..922
                            src/resources/vendorlibs/angularjs-datepicker/angular-datepicker.js on lines 927..930

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

                            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

                                      angular.element(document.getElementById($scope.datepickerAppendTo.replace('#', ''))).append($compile(angular.element(htmlTemplate))($scope, function afterCompile(el) {
                            
                                        theCalendar = angular.element(el)[0];
                                      }));
                            src/resources/vendorlibs/angularjs-datepicker/angular-datepicker.js on lines 919..922
                            src/resources/vendorlibs/angularjs-datepicker/angular-datepicker.js on lines 934..937

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

                            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