crmis/weddings

View on GitHub

Showing 334 of 334 total issues

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

            if (factor.from.y !== factor.to.y) {
                props = props.concat(vProps);
                el.from = $.effects.setTransition(el, vProps, factor.from.y, el.from);
                el.to = $.effects.setTransition(el, vProps, factor.to.y, el.to);
            }
Severity: Major
Found in app/assets/javascripts/viewable_calendar-editable.js and 1 other location - About 3 hrs to fix
app/assets/javascripts/viewable_calendar-editable.js on lines 6904..6908

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

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

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

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

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

Refactorings

Further Reading

Function _fetchEventSource has 74 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        function _fetchEventSource(source, callback) {
            var i;
            var fetchers = fc.sourceFetchers;
            var res;
            for (i = 0; i < fetchers.length; i++) {
Severity: Major
Found in app/assets/javascripts/viewable_fullcalendar.js - About 2 hrs to fix

    Function formatDates has 74 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        function formatDates(date1, date2, format, options) {
            options = options || defaults;
            var date = date1,
                otherDate = date2,
                i, len = format.length, c,
    Severity: Major
    Found in app/assets/javascripts/viewable_fullcalendar.js - About 2 hrs to fix

      Function _mouseDrag has 74 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              _mouseDrag: function (event) {
                  var i, item, itemElement, intersection,
                      o = this.options,
                      scrolled = false;
      
      
      Severity: Major
      Found in app/assets/javascripts/viewable_calendar-editable.js - About 2 hrs to fix

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

                        $(document).one('mouseup', function (ev) {
                            hoverListener.stop();
                            if (dates) {
                                if (+dates[0] == +dates[1]) {
                                    reportDayClick(dates[0], false, ev);
        Severity: Major
        Found in app/assets/javascripts/viewable_fullcalendar.js and 1 other location - About 2 hrs to fix
        app/assets/javascripts/viewable_fullcalendar.js on lines 5969..5977

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

        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

                        $(document).one('mouseup', function (ev) {
                            hoverListener.stop();
                            if (dates) {
                                if (+dates[0] == +dates[1]) {
                                    reportDayClick(dates[0], true, ev);
        Severity: Major
        Found in app/assets/javascripts/viewable_fullcalendar.js and 1 other location - About 2 hrs to fix
        app/assets/javascripts/viewable_fullcalendar.js on lines 3663..3671

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

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

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

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

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

        Refactorings

        Further Reading

        Function widget has 72 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            $.widget = function (name, base, prototype) {
                var fullName, existingConstructor, constructor, basePrototype,
                // proxiedPrototype allows the provided prototype to remain unmodified
                // so that it can be used as a mixin for multiple widgets (#8876)
                    proxiedPrototype = {},
        Severity: Major
        Found in app/assets/javascripts/viewable_calendar-editable.js - About 2 hrs to fix

          Function buildSkeleton has 72 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  function buildSkeleton() {
                      var headerClass = tm + "-widget-header";
                      var contentClass = tm + "-widget-content";
                      var s;
                      var d;
          Severity: Major
          Found in app/assets/javascripts/viewable_fullcalendar.js - About 2 hrs to fix

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

                        $.extend(this.offset, {
                            click: { //Where the click happened, relative to the element
                                left: event.pageX - this.offset.left,
                                top: event.pageY - this.offset.top
                            },
            Severity: Major
            Found in app/assets/javascripts/viewable_calendar-editable.js and 1 other location - About 2 hrs to fix
            app/assets/javascripts/viewable_calendar-editable.js on lines 1603..1610

            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

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

                        $.extend(this.offset, {
                            click: { //Where the click happened, relative to the element
                                left: event.pageX - this.offset.left,
                                top: event.pageY - this.offset.top
                            },
            Severity: Major
            Found in app/assets/javascripts/viewable_calendar-editable.js and 1 other location - About 2 hrs to fix
            app/assets/javascripts/viewable_calendar-editable.js on lines 4247..4254

            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

                        if (that._helper && !o.animate && (/relative/).test(ce.css("position"))) {
                            $(this).css({left: ho.left - cop.left - co.left, width: w, height: h});
                        }
            Severity: Major
            Found in app/assets/javascripts/viewable_calendar-editable.js and 1 other location - About 2 hrs to fix
            app/assets/javascripts/viewable_calendar-editable.js on lines 3620..3622

            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

                        if (that._helper && !o.animate && (/static/).test(ce.css("position"))) {
                            $(this).css({left: ho.left - cop.left - co.left, width: w, height: h});
                        }
            Severity: Major
            Found in app/assets/javascripts/viewable_calendar-editable.js and 1 other location - About 2 hrs to fix
            app/assets/javascripts/viewable_calendar-editable.js on lines 3616..3618

            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

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

                    _contactContainers: function (event) {
                        var i, j, dist, itemWithLeastDistance, posProperty, sizeProperty, base, cur, nearBottom, floating,
                            innermostContainer = null,
                            innermostIndex = null;
            
            
            Severity: Major
            Found in app/assets/javascripts/viewable_calendar-editable.js - About 2 hrs to fix

              Function SelectionManager has 70 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  function SelectionManager() {
                      var t = this;
              
              
                      // exports
              Severity: Major
              Found in app/assets/javascripts/viewable_fullcalendar.js - About 2 hrs to fix

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

                  included do
                
                    validates :start_time, presence: true
                    validates :length, presence: true, numericality: {greater_than: 0}
                    validate :start_date_cannot_be_in_the_past
                Severity: Major
                Found in app/models/concerns/bookable.rb and 1 other location - About 2 hrs to fix
                app/models/concerns/viewable.rb on lines 5..25

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

                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

                  included do
                
                    validates :start_time, presence: true
                    validates :length, presence: true, numericality: {greater_than: 0}
                    validate :start_date_cannot_be_in_the_past
                Severity: Major
                Found in app/models/concerns/viewable.rb and 1 other location - About 2 hrs to fix
                app/models/concerns/bookable.rb on lines 4..23

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

                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

                            dayHeadCells.each(function (i, _e) {
                                e = $(_e);
                                n = e.offset().left;
                                if (i) {
                                    p[1] = n;
                Severity: Major
                Found in app/assets/javascripts/viewable_fullcalendar.js and 1 other location - About 2 hrs to fix
                app/assets/javascripts/viewable_fullcalendar.js on lines 2608..2616

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

                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

                            headCells.each(function (i, _e) {
                                e = $(_e);
                                n = e.offset().left;
                                if (i) {
                                    p[1] = n;
                Severity: Major
                Found in app/assets/javascripts/viewable_fullcalendar.js and 1 other location - About 2 hrs to fix
                app/assets/javascripts/viewable_fullcalendar.js on lines 3439..3447

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

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

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

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

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

                Refactorings

                Further Reading

                Function drag has 62 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        drag: function (event, ui) {
                
                            var inst = $(this).data("ui-draggable"), that = this;
                
                            $.each(inst.sortables, function () {
                Severity: Major
                Found in app/assets/javascripts/viewable_calendar-editable.js - About 2 hrs to fix

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

                                  if (!inst.snapElements[i].snapping && (ts || bs || ls || rs || first)) {
                                      (inst.options.snap.snap && inst.options.snap.snap.call(inst.element, event, $.extend(inst._uiHash(), {snapItem: inst.snapElements[i].item})));
                                  }
                  Severity: Major
                  Found in app/assets/javascripts/viewable_calendar-editable.js and 1 other location - About 2 hrs to fix
                  app/assets/javascripts/viewable_calendar-editable.js on lines 2329..2331

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

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

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

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

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

                  Refactorings

                  Further Reading

                  Severity
                  Category
                  Status
                  Source
                  Language