smartinmedia/cunity

View on GitHub

Showing 617 of 617 total issues

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

        formatInputTooShort: function (input, min) { var n = min - input.length; return "Παρακαλούμε εισάγετε " + n + " περισσότερο" + (n > 1 ? "υς" : "") + " χαρακτήρ" + (n > 1 ? "ες" : "α"); },
Severity: Major
Found in lib/plugins/select2/select2_locale_el.js and 1 other location - About 1 hr to fix
lib/plugins/select2/select2_locale_fr.js on lines 10..10

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

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 addUsersToConversation has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    public function addUsersToConversation($cid, $users, $invitation = false, $notify = true)
    {
        if (is_array($users) && !empty($users)) {
            foreach ($users as $user) {
                $this->insert(['userid' => intval($user), 'conversation_id' => intval($cid)]);
Severity: Minor
Found in lib/modules/Messages/Models/Db/Table/Conversations.php - About 1 hr 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

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

        onmousemove: function (a) {
            this.touchStart && ((a.originalEvent || a).touches = [
                {pageX: a.pageX, pageY: a.pageY}
            ], this.ontouchmove(a))
        },
lib/modules/Gallery/styles/javascript/blueimp-gallery.min.js on lines 242..246

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

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 send has 43 lines of code (exceeds 25 allowed). Consider refactoring.
Open

                send: function (n, r) {
                    var s = this, l = "Mozilla" === u.browser && u.version >= 4 && u.version < 7, f = "Android Browser" === u.browser, m = !1;
                    if (h = n.url.replace(/^.+?\/([\w\-\.]+)$/, "$1").toLowerCase(), p = c(), p.open(n.method, n.url, n.async, n.user, n.password), r instanceof o)r.isDetached() && (m = !0), r = r.getSource(); else if (r instanceof a) {
                        if (r.hasBlob())if (r.getBlob().isDetached())r = d.call(s, r), m = !0; else if ((l || f) && "blob" === t.typeOf(r.getBlob().getSource()) && window.FileReader)return e.call(s, n, r), void 0;
                        if (r instanceof a) {
Severity: Minor
Found in lib/plugins/plupload/js/plupload.full.min.js - About 1 hr to fix

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

            function p() {
                var d, v, g, y;
                if (n.status == o.DONE || n.status == o.FAILED || e.state == o.STOPPED)return;
                g = {name: n.target_name || n.name}, s && a.chunks && c.size > s ? (y = Math.min(s, c.size - f), d = c.slice(f, f + y)) : (y = c.size, d = c), s && a.chunks && (e.settings.send_chunk_number ? (g.chunk = Math.ceil(f / s), g.chunks = Math.ceil(c.size / s)) : (g.offset = f, g.total = c.size)), m = new t.XMLHttpRequest, m.upload && (m.upload.onprogress = function (t) {
                    n.loaded = Math.min(n.size, f + t.loaded), e.trigger("UploadProgress", n)
Severity: Minor
Found in lib/plugins/plupload/js/plupload.full.min.js - About 1 hr to fix

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

        prepareOpts: function () {
            var opts = this.parent.prepareOpts.apply(this, arguments),
                self=this;

            // TODO validate placeholder is a string if specified
Severity: Minor
Found in lib/plugins/select2/select2.js - About 1 hr to fix

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

        carouselOptions: {
            hiddenPageScrollbars: !1,
            toggleControlsOnReturn: !1,
            toggleSlideshowOnSpace: !1,
            enableKeyboardNavigation: !1,
lib/modules/Gallery/styles/javascript/jquery.blueimp-gallery.min.js on lines 63..73

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

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

        carouselOptions: {
            hiddenPageScrollbars: !1,
            toggleControlsOnReturn: !1,
            toggleSlideshowOnSpace: !1,
            enableKeyboardNavigation: !1,
lib/modules/Gallery/styles/javascript/blueimp-gallery.min.js on lines 115..125

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

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 embed has 42 lines of code (exceeds 25 allowed). Consider refactoring.
Open

                embed: function (i) {
                    function r() {
                        if (u.can("create_canvas")) {
                            var t = a.getAsCanvas();
                            if (t)return i.appendChild(t), t = null, a.destroy(), o.trigger("embedded"), void 0
Severity: Minor
Found in lib/plugins/plupload/js/plupload.full.min.js - About 1 hr to fix

Function openChatBox has 42 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function openChatBox(data) {
    updateStorageData(data);

    if (data.users == '') {
        return;
Severity: Minor
Found in lib/modules/Messages/styles/javascript/chat.js - About 1 hr to fix

Function val has 42 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        val: function () {
            var val,
                triggerChange = false,
                data = null,
                self = this,
Severity: Minor
Found in lib/plugins/select2/select2.js - About 1 hr to fix

Function load has 42 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function load(refresh, filter) {
    $("#newsfeed-posts > .alert-danger").hide();
    refreshId = 0;
    if (refresh) {
        refreshId = $("#newsfeed-posts > .newsfeed-post:first").data("id");
Severity: Minor
Found in lib/modules/Newsfeed/styles/javascript/newsfeed.js - About 1 hr to fix

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

            if (n == 1) {
                return "Prosím, zadajte o jeden znak menej";
            } else if (n >= 2 && n <= 4) {
                return "Prosím, zadajte o "+smallNumbers[n](true)+" znaky menej";
            } else {
Severity: Major
Found in lib/plugins/select2/select2_locale_sk.js and 1 other location - About 1 hr to fix
lib/plugins/select2/select2_locale_sk.js on lines 37..43

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

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

                }), v.append(e.settings.file_data_name, d), m.send(v, {
                    runtime_order: e.settings.runtimes,
                    required_caps: e.settings.required_features,
                    preferred_caps: l,
                    swf_url: e.settings.flash_swf_url,
Severity: Major
Found in lib/plugins/plupload/js/plupload.full.min.js and 1 other location - About 1 hr to fix
lib/plugins/plupload/js/plupload.full.min.js on lines 3511..3517

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

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 (checkFormatter(opts.formatInputTooShort, "formatInputTooShort")) {
                    render("<li class='select2-no-results'>" + evaluate(opts.formatInputTooShort, opts.element, search.val(), opts.minimumInputLength) + "</li>");
                } else {
                    render("");
                }
Severity: Major
Found in lib/plugins/select2/select2.js and 1 other location - About 1 hr to fix
lib/plugins/select2/select2.js on lines 1777..1781

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

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

                }), m.send(d, {
                    runtime_order: e.settings.runtimes,
                    required_caps: e.settings.required_features,
                    preferred_caps: l,
                    swf_url: e.settings.flash_swf_url,
Severity: Major
Found in lib/plugins/plupload/js/plupload.full.min.js and 1 other location - About 1 hr to fix
lib/plugins/plupload/js/plupload.full.min.js on lines 3503..3509

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

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 (checkFormatter(opts.formatInputTooLong, "formatInputTooLong")) {
                    render("<li class='select2-no-results'>" + evaluate(opts.formatInputTooLong, opts.element, search.val(), opts.maximumInputLength) + "</li>");
                } else {
                    render("");
                }
Severity: Major
Found in lib/plugins/select2/select2.js and 1 other location - About 1 hr to fix
lib/plugins/select2/select2.js on lines 1767..1771

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

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 (limit == 1) {
                return "Môžete zvoliť len jednu položku";
            } else if (limit >= 2 && limit <= 4) {
                return "Môžete zvoliť najviac "+smallNumbers[limit](false)+" položky";
            } else {
Severity: Major
Found in lib/plugins/select2/select2_locale_sk.js and 1 other location - About 1 hr to fix
lib/plugins/select2/select2_locale_sk.js on lines 28..34

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

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 u has 41 lines of code (exceeds 25 allowed). Consider refactoring.
Open

            function u(t) {
                function i() {
                    k.destroy(), k = null, s.dispatchEvent("loadend"), s = null
                }

Severity: Minor
Found in lib/plugins/plupload/js/plupload.full.min.js - About 1 hr to fix

Function destroy has 41 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        destroy: function () {
            var element=this.opts.element, select2 = element.data("select2"), self = this;

            this.close();

Severity: Minor
Found in lib/plugins/select2/select2.js - About 1 hr to fix
Severity
Category
Status
Source
Language