smartinmedia/cunity

View on GitHub

Showing 617 of 617 total issues

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

    $("#thread-new-emoticon-button").popover({
        html: true,
        container: 'body',
        content: function() {
            return $("#thread-new-emoticons > div").html();
Severity: Major
Found in lib/modules/Forums/styles/javascript/thread.js and 2 other locations - About 45 mins to fix
lib/modules/Forums/styles/javascript/board.js on lines 10..16
lib/modules/Messages/styles/javascript/conversation.js on lines 75..81

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

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

    $(".conversation-add-emoticon").popover({
        html: true,
        container: 'body',
        content: function () {
            return $("#conversation-emoticon-list > div").html();
Severity: Major
Found in lib/modules/Messages/styles/javascript/conversation.js and 2 other locations - About 45 mins to fix
lib/modules/Forums/styles/javascript/board.js on lines 10..16
lib/modules/Forums/styles/javascript/thread.js on lines 14..20

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

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

    for (x in smileys)
        res.data.message = res.data.message.replace('[:' + x + ':]', smileys[x]);
Severity: Minor
Found in lib/modules/Messages/styles/javascript/chat.js and 1 other location - About 45 mins to fix
lib/modules/Messages/styles/javascript/conversation.js on lines 139..140

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

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

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

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

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

Refactorings

Further Reading

Avoid deeply nested control flow statements.
Open

                                                if (this.o.minViewMode === 2) {
                                                    this._setDate(UTCDate(year, month, day));
                                                }
Severity: Major
Found in lib/plugins/bootstrap-datepicker/js/bootstrap-datepicker.js - About 45 mins to fix

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

        prev: function () {
            (this.options.continuous || this.index) && this.slide(this.index - 1)
        },
Severity: Minor
Found in lib/modules/Gallery/styles/javascript/blueimp-gallery.min.js and 1 other location - About 40 mins to fix
lib/modules/Gallery/styles/javascript/jquery.blueimp-gallery.min.js on lines 121..123

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

            for (g in res.guests.attending) {
                $("#guestlist-attending").append(tmpl('guest-item', res.guests.attending[g]));
            }
Severity: Major
Found in lib/modules/Events/styles/javascript/event.js and 2 other locations - About 40 mins to fix
lib/modules/Events/styles/javascript/event.js on lines 87..89
lib/modules/Events/styles/javascript/event.js on lines 90..92

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

        prev: function () {
            (this.options.continuous || this.index) && this.slide(this.index - 1)
        },
lib/modules/Gallery/styles/javascript/blueimp-gallery.min.js on lines 173..175

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

            for (g in res.guests.invited) {
                $("#guestlist-invited").append(tmpl('guest-item', res.guests.invited[g]));
            }
Severity: Major
Found in lib/modules/Events/styles/javascript/event.js and 2 other locations - About 40 mins to fix
lib/modules/Events/styles/javascript/event.js on lines 90..92
lib/modules/Events/styles/javascript/event.js on lines 93..95

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

            for (g in res.guests.maybe) {
                $("#guestlist-maybe").append(tmpl('guest-item', res.guests.maybe[g]));
            }
Severity: Major
Found in lib/modules/Events/styles/javascript/event.js and 2 other locations - About 40 mins to fix
lib/modules/Events/styles/javascript/event.js on lines 87..89
lib/modules/Events/styles/javascript/event.js on lines 93..95

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

Consider simplifying this complex logical expression.
Open

            if (!a.scheme) {
                n && "string" != typeof n || (n = e(n || document.location.href)), a.scheme = n.scheme, a.host = n.host, a.port = n.port;
                var c = "";
                /^[^\/]/.test(a.path) && (c = n.path, /(\/|\/[^\.]+)$/.test(c) ? c += "/" : c = c.replace(/\/[^\/]+$/, "/")), a.path = c + (a.path || "")
            }
Severity: Major
Found in lib/plugins/plupload/js/plupload.full.min.js - About 40 mins to fix

Consider simplifying this complex logical expression.
Open

            if (t = t, n = n || s.body, t && t.getBoundingClientRect && "IE" === e.browser && (!s.documentMode || s.documentMode < 8))return u = i(t), c = i(n), {
                x: u.x - c.x,
                y: u.y - c.y
            };
Severity: Major
Found in lib/plugins/plupload/js/plupload.full.min.js - About 40 mins to fix

Consider simplifying this complex logical expression.
Open

                if (selected.length &&
                    (e.which == KEY.LEFT || e.which == KEY.RIGHT || e.which == KEY.BACKSPACE || e.which == KEY.DELETE || e.which == KEY.ENTER)) {
                    var selectedChoice = selected;
                    if (e.which == KEY.LEFT && prev.length) {
                        selectedChoice = prev;
Severity: Major
Found in lib/plugins/select2/select2.js - About 40 mins to fix

Consider simplifying this complex logical expression.
Open

                for (r = 0; i > r; r++)if (p = f = e + 12 * r + 2, s = n[a.SHORT(p)], s !== t) {
                    switch (u = a.SHORT(p += 2), d = a.LONG(p += 2), p += 4, m = [], u) {
                        case 1:
                        case 7:
                            for (d > 4 && (p = a.LONG(p) + c.tiffHeader), o = 0; d > o; o++)m[o] = a.BYTE(p + o);
Severity: Major
Found in lib/plugins/plupload/js/plupload.full.min.js - About 40 mins to fix

Consider simplifying this complex logical expression.
Open

                if (b || (b = this.options.transitionSpeed), this.support.transition) {
                    for (this.options.continuous || (a = this.circle(a)), c = Math.abs(f - a) / (f - a), this.options.continuous && (d = c, c = -this.positions[this.circle(a)] / this.slideWidth, c !== d && (a = -c * this.num + a)), e = Math.abs(f - a) - 1; e;)e -= 1, this.move(this.circle((a > f ? a : f) - e - 1), this.slideWidth * c, 0);
                    a = this.circle(a), this.move(f, this.slideWidth * c, b), this.move(a, 0, b), this.options.continuous && this.move(this.circle(a - c), -(this.slideWidth * c), 0)
                } else a = this.circle(a), this.animate(f * -this.slideWidth, a * -this.slideWidth, b);
Severity: Major
Found in lib/modules/Gallery/styles/javascript/jquery.blueimp-gallery.min.js - About 40 mins to fix

Consider simplifying this complex logical expression.
Open

                if (b || (b = this.options.transitionSpeed), this.support.transition) {
                    for (this.options.continuous || (a = this.circle(a)), c = Math.abs(f - a) / (f - a), this.options.continuous && (d = c, c = -this.positions[this.circle(a)] / this.slideWidth, c !== d && (a = -c * this.num + a)), e = Math.abs(f - a) - 1; e;)e -= 1, this.move(this.circle((a > f ? a : f) - e - 1), this.slideWidth * c, 0);
                    a = this.circle(a), this.move(f, this.slideWidth * c, b), this.move(a, 0, b), this.options.continuous && this.move(this.circle(a - c), -(this.slideWidth * c), 0)
                } else a = this.circle(a), this.animate(f * -this.slideWidth, a * -this.slideWidth, b);
Severity: Major
Found in lib/modules/Gallery/styles/javascript/blueimp-gallery.min.js - About 40 mins to fix

Consider simplifying this complex logical expression.
Open

                    if ("image/jpeg" !== e)_ = c(v.getAsDataURL(e, t)); else {
                        var n;
                        t || (t = 90);
                        try {
                            n = E.toDataURL("image/jpeg", t / 100)
Severity: Major
Found in lib/plugins/plupload/js/plupload.full.min.js - About 40 mins to fix

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

        formatInputTooShort: function (input, min) { var n = min - input.length; return "Var god skriv in " + n + (n>1 ? " till tecken" : " tecken till"); },
Severity: Minor
Found in lib/plugins/select2/select2_locale_sv.js and 1 other location - About 40 mins to fix
lib/plugins/select2/select2_locale_nb.js on lines 13..13

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

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

                    e = this.getShimContainer(), e.innerHTML = '<object id="' + this.uid + '" data="data:application/x-silverlight," type="application/x-silverlight-2" width="100%" height="100%" style="outline:none;">' + '<param name="source" value="' + a.xap_url + '"/>' + '<param name="background" value="Transparent"/>' + '<param name="windowless" value="true"/>' + '<param name="enablehtmlaccess" value="true"/>' + '<param name="initParams" value="uid=' + this.uid + ",target=" + t.global_event_dispatcher + '"/>' + "</object>", l = setTimeout(function () {
                        c && !c.initialized && c.trigger("Error", new i.RuntimeError(i.RuntimeError.NOT_INIT_ERR))
                    }, "Windows" !== t.OS ? 1e4 : 5e3)
Severity: Minor
Found in lib/plugins/plupload/js/plupload.full.min.js and 1 other location - About 40 mins to fix
lib/plugins/plupload/js/plupload.full.min.js on lines 2626..2628

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

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

                        setEndDate: function(endDate) {
                            this._process_options({endDate: endDate});
                            this.update();
                            this.updateNavArrows();
                        },
Severity: Minor
Found in lib/plugins/bootstrap-datepicker/js/bootstrap-datepicker.js and 2 other locations - About 40 mins to fix
lib/plugins/bootstrap-datepicker/js/bootstrap-datepicker.js on lines 507..511
lib/plugins/bootstrap-datepicker/js/bootstrap-datepicker.js on lines 517..521

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

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

        e.length && !e.regexp.test(t.name) ? (this.trigger("Error", {
            code: o.FILE_EXTENSION_ERROR,
            message: o.translate("File extension error."),
            file: t
        }), n(!1)) : n(!0)
Severity: Minor
Found in lib/plugins/plupload/js/plupload.full.min.js and 1 other location - About 40 mins to fix
lib/plugins/plupload/js/plupload.full.min.js on lines 3277..3281

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

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