Jupiterrr/Vorlesungsverzeichnis

View on GitHub
lib/assets/weekcalendar/jquery.weekcalendar.js

Summary

Maintainability
F
6 days
Test Coverage

File jquery.weekcalendar.js has 1032 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*
 * jQuery.weekCalendar v1.2.3-pre
 * http://www.redredred.com.au/
 *
 * Requires:
Severity: Major
Found in lib/assets/weekcalendar/jquery.weekcalendar.js - About 2 days to fix

    Function _renderCalendar has 75 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

          _renderCalendar : function() {
    
             var $calendarContainer, calendarNavHtml, calendarHeaderHtml, calendarBodyHtml, $weekDayColumns;
             var self = this;
             var options = this.options;
    Severity: Major
    Found in lib/assets/weekcalendar/jquery.weekcalendar.js - About 3 hrs to fix

      Function _setupEventCreationForWeekDay has 51 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

            _setupEventCreationForWeekDay : function($weekDay) {
               var self = this;
               var options = this.options;
               $weekDay.mousedown(function(event) {
                  var $target = $(event.target);
      Severity: Major
      Found in lib/assets/weekcalendar/jquery.weekcalendar.js - About 2 hrs to fix

        Function _renderEvents has 39 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

              _renderEvents : function (data, $weekDayColumns) {
        
                 this._clearCalendar();
        
                 var self = this;
        Severity: Minor
        Found in lib/assets/weekcalendar/jquery.weekcalendar.js - About 1 hr to fix

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

             $.weekCalendar = function() {
                return {
                   parseISO8601 : function(s, ignoreTimezone) {
          
                      // derived from http://delete.me.uk/2005/03/iso8601.html
          Severity: Minor
          Found in lib/assets/weekcalendar/jquery.weekcalendar.js - About 1 hr to fix

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

                  _groupOverlappingEventElements : function($weekDay) {
                     var $events = $weekDay.find(".wc-cal-event:visible");
                     var sortedEvents = $events.sort(function(a, b) {
                        return $(a).data("calEvent").start.getTime() - $(b).data("calEvent").start.getTime();
                     });
            Severity: Minor
            Found in lib/assets/weekcalendar/jquery.weekcalendar.js - About 1 hr to fix

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

                    _adjustForEventCollisions : function($weekDay, $calEvent, newCalEvent, oldCalEvent, maintainEventDuration) {
                       var options = this.options;
              
                       if (options.allowCalEventOverlap) {
                          return;
              Severity: Minor
              Found in lib/assets/weekcalendar/jquery.weekcalendar.js - About 1 hr to fix

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

                         parseISO8601 : function(s, ignoreTimezone) {
                
                            // derived from http://delete.me.uk/2005/03/iso8601.html
                            var regexp = "([0-9]{4})(-([0-9]{2})(-([0-9]{2})" +
                                         "(T([0-9]{2}):([0-9]{2})(:([0-9]{2})(\.([0-9]+))?)?" +
                Severity: Minor
                Found in lib/assets/weekcalendar/jquery.weekcalendar.js - About 1 hr to fix

                  Function _loadCalEvents has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                        _loadCalEvents : function(dateWithinWeek) {
                  
                           var date, weekStartDate, endDate, $weekDayColumns;
                           var self = this;
                  
                  
                  Severity: Minor
                  Found in lib/assets/weekcalendar/jquery.weekcalendar.js - About 1 hr to fix

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

                          _setupEventDelegation : function() {
                             var self = this;
                             var options = this.options;
                             this.element.click(function(event) {
                                var $target = $(event.target);
                    Severity: Minor
                    Found in lib/assets/weekcalendar/jquery.weekcalendar.js - About 1 hr to fix

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

                            _adjustOverlappingEvents : function($weekDay) {
                               var self = this;
                               if (self.options.allowCalEventOverlap) {
                                  var groupsList = self._groupOverlappingEventElements($weekDay);
                                  $.each(groupsList, function() {
                      Severity: Minor
                      Found in lib/assets/weekcalendar/jquery.weekcalendar.js - About 1 hr to fix

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

                              _addDroppableToWeekDay : function($weekDay) {
                                 var self = this;
                                 var options = this.options;
                                 $weekDay.droppable({
                                    accept: ".wc-cal-event",
                        Severity: Minor
                        Found in lib/assets/weekcalendar/jquery.weekcalendar.js - About 1 hr to fix

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

                                _adjustForEventCollisions : function($weekDay, $calEvent, newCalEvent, oldCalEvent, maintainEventDuration) {
                          Severity: Minor
                          Found in lib/assets/weekcalendar/jquery.weekcalendar.js - About 35 mins to fix

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

                                        if (newCalEvent.start.getTime() < currentCalEvent.end.getTime()
                                              && newCalEvent.end.getTime() >= currentCalEvent.end.getTime()) {
                            
                                           adjustedStart = currentCalEvent.end;
                                        }
                            Severity: Major
                            Found in lib/assets/weekcalendar/jquery.weekcalendar.js and 1 other location - About 2 hrs to fix
                            lib/assets/weekcalendar/jquery.weekcalendar.js on lines 919..923

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

                            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 (newCalEvent.end.getTime() > currentCalEvent.start.getTime()
                                              && newCalEvent.start.getTime() <= currentCalEvent.start.getTime()) {
                            
                                           adjustedEnd = currentCalEvent.start;
                                        }
                            Severity: Major
                            Found in lib/assets/weekcalendar/jquery.weekcalendar.js and 1 other location - About 2 hrs to fix
                            lib/assets/weekcalendar/jquery.weekcalendar.js on lines 911..915

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

                            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

                                        if (lastEndTime.getTime() < $curEvent.data("calEvent").end.getTime()) {
                                           lastEndTime = $curEvent.data("calEvent").end;
                                        }
                            Severity: Major
                            Found in lib/assets/weekcalendar/jquery.weekcalendar.js and 1 other location - About 1 hr to fix
                            lib/assets/weekcalendar/jquery.weekcalendar.js on lines 801..803

                            Duplicated Code

                            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                            Tuning

                            This issue has a mass of 56.

                            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                            Refactorings

                            Further Reading

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

                                                 if (lastEndTime.getTime() < $curEvent.data("calEvent").end.getTime()) {
                                                    lastEndTime = $curEvent.data("calEvent").end;
                                                 }
                            Severity: Major
                            Found in lib/assets/weekcalendar/jquery.weekcalendar.js and 1 other location - About 1 hr to fix
                            lib/assets/weekcalendar/jquery.weekcalendar.js on lines 810..812

                            Duplicated Code

                            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                            Tuning

                            This issue has a mass of 56.

                            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                            Refactorings

                            Further Reading

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

                                  formatTime : function(date, format) {
                                     if (format) {
                                        return this._formatDate(date, format);
                                     } else {
                                        return this._formatDate(date, this.options.timeFormat);
                            Severity: Major
                            Found in lib/assets/weekcalendar/jquery.weekcalendar.js and 1 other location - About 1 hr to fix
                            lib/assets/weekcalendar/jquery.weekcalendar.js on lines 236..242

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

                            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

                                  formatDate : function(date, format) {
                                     if (format) {
                                        return this._formatDate(date, format);
                                     } else {
                                        return this._formatDate(date, this.options.dateFormat);
                            Severity: Major
                            Found in lib/assets/weekcalendar/jquery.weekcalendar.js and 1 other location - About 1 hr to fix
                            lib/assets/weekcalendar/jquery.weekcalendar.js on lines 244..250

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

                            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

                                     $calEvent.css({lineHeight: (options.timeslotHeight - 2) + "px", fontSize: (options.timeslotHeight / 2) + "px"});
                            Severity: Minor
                            Found in lib/assets/weekcalendar/jquery.weekcalendar.js and 1 other location - About 35 mins to fix
                            lib/assets/weekcalendar/jquery.weekcalendar.js on lines 484..484

                            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

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

                                           $newEvent.css({lineHeight: (options.timeslotHeight - 2) + "px", fontSize: (options.timeslotHeight / 2) + "px"});
                            Severity: Minor
                            Found in lib/assets/weekcalendar/jquery.weekcalendar.js and 1 other location - About 35 mins to fix
                            lib/assets/weekcalendar/jquery.weekcalendar.js on lines 714..714

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

                                     self.element.find(".wc-day-column-inner").each(function() {
                                        self._adjustOverlappingEvents($(this));
                                     });
                            Severity: Minor
                            Found in lib/assets/weekcalendar/jquery.weekcalendar.js and 1 other location - About 30 mins to fix
                            lib/assets/weekcalendar/jquery.weekcalendar.js on lines 197..199

                            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

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

                                     self.element.find(".wc-day-column-inner").each(function() {
                                        self._adjustOverlappingEvents($(this));
                                     });
                            Severity: Minor
                            Found in lib/assets/weekcalendar/jquery.weekcalendar.js and 1 other location - About 30 mins to fix
                            lib/assets/weekcalendar/jquery.weekcalendar.js on lines 179..181

                            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

                            There are no issues that match your filters.

                            Category
                            Status