smartinmedia/cunity

View on GitHub

Showing 265 of 617 total issues

File plupload.full.min.js has 3530 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/**
 * mOxie - multi-runtime File API & XMLHttpRequest L2 Polyfill
 * v1.2.0
 *
 * Copyright 2013, Moxiecode Systems AB
Severity: Major
Found in lib/plugins/plupload/js/plupload.full.min.js - About 1 wk to fix

File select2.js has 2604 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*
Copyright 2012 Igor Vaynberg

Version: @@ver@@ Timestamp: @@timestamp@@

Severity: Major
Found in lib/plugins/select2/select2.js - About 1 wk to fix

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

/* =========================================================
 * bootstrap-datepicker.js
 * Repo: https://github.com/eternicode/bootstrap-datepicker/
 * Demo: http://eternicode.github.io/bootstrap-datepicker/
 * Docs: http://bootstrap-datepicker.readthedocs.org/
Severity: Major
Found in lib/plugins/bootstrap-datepicker/js/bootstrap-datepicker.js - About 3 days to fix

File Install.php has 935 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

/**
 * ########################################################################################
 * ## CUNITY(R) V2.0 - An open source social network / "your private social network"     ##
Severity: Major
Found in installer/Install.php - About 2 days to fix

Function Uploader has 359 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    }), o.Uploader = function (e) {
        function g() {
            var e, t = 0, n;
            if (this.state == o.STARTED) {
                for (n = 0; n < f.length; n++)!e && f[n].status == o.QUEUED ? (e = f[n], this.trigger("BeforeUpload", e) && (e.status = o.UPLOADING, this.trigger("UploadFile", e))) : t++;
Severity: Major
Found in lib/plugins/plupload/js/plupload.full.min.js - About 1 day to fix

File jquery.blueimp-gallery.min.js has 667 lines of code (exceeds 250 allowed). Consider refactoring.
Open

!function (a) {
    "use strict";
    "function" == typeof define && define.amd ? define(["./blueimp-helper"], a) : (window.blueimp = window.blueimp || {}, window.blueimp.Gallery = a(window.blueimp.helper || window.jQuery))
}(function (a) {
    "use strict";
Severity: Major
Found in lib/modules/Gallery/styles/javascript/jquery.blueimp-gallery.min.js - About 1 day to fix

File blueimp-gallery.min.js has 656 lines of code (exceeds 250 allowed). Consider refactoring.
Open

!function () {
    "use strict";
    function a(a, b) {
        var c;
        for (c in b)b.hasOwnProperty(c) && (a[c] = b[c]);
Severity: Major
Found in lib/modules/Gallery/styles/javascript/blueimp-gallery.min.js - About 1 day to fix

Function n has 188 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        var n = function (e) {
            var t = "", n = "?", i = "function", r = "undefined", o = "object", a = "major", s = "model", u = "name", c = "type", l = "vendor", d = "version", f = "architecture", p = "console", h = "mobile", m = "tablet", g = {
                has: function (e, t) {
                    return -1 !== t.toLowerCase().indexOf(e.toLowerCase())
                }, lowerize: function (e) {
Severity: Major
Found in lib/plugins/plupload/js/plupload.full.min.js - About 7 hrs to fix

Function i has 177 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        return function i() {
            function i(e, n) {
                var i = a.SHORT(e), r, o, s, u, d, f, p, h, m = [], g = {};
                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) {
Severity: Major
Found in lib/plugins/plupload/js/plupload.full.min.js - About 7 hrs to fix

File calendar.min.js has 432 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/**
 * Bootstrap based calendar full view.
 *
 * https://github.com/Serhioromano/bootstrap-calendar
 *
Severity: Minor
Found in lib/plugins/calendar/js/calendar.min.js - About 6 hrs to fix

Function initContainer has 147 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        initContainer: function () {

            var selection,
                container = this.container,
                dropdown = this.dropdown,
Severity: Major
Found in lib/plugins/select2/select2.js - About 5 hrs to fix

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

        function p() {
            function i(e) {
                e || (e = this.getRuntime().exec.call(this, "Image", "getInfo")), this.size = e.size, this.width = e.width, this.height = e.height, this.type = e.type, this.meta = e.meta, "" === this.name && (this.name = e.name)
            }

Severity: Major
Found in lib/plugins/plupload/js/plupload.full.min.js - About 5 hrs to fix

Function initContainer has 144 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        initContainer: function () {

            var selector = ".select2-choices", selection;

            this.searchContainer = this.container.find(".select2-search-field");
Severity: Major
Found in lib/plugins/select2/select2.js - About 5 hrs to fix

Function c has 141 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        function c() {
            function e() {
                if (!E && !y)throw new n.ImageError(n.DOMException.INVALID_STATE_ERR);
                return E || y
            }
Severity: Major
Found in lib/plugins/plupload/js/plupload.full.min.js - About 5 hrs to fix

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

        prepareOpts: function (opts) {
            var element, select, idKey, ajaxUrl, self = this;

            element = opts.element;

Severity: Major
Found in lib/plugins/select2/select2.js - About 5 hrs to fix

Function keydown has 114 lines of code (exceeds 25 allowed). Consider refactoring.
Open

                        keydown: function(e) {
                            if (this.picker.is(':not(:visible)')) {
                                if (e.keyCode === 27) // allow escape to hide and re-show picker
                                    this.show();
                                return;
Severity: Major
Found in lib/plugins/bootstrap-datepicker/js/bootstrap-datepicker.js - About 4 hrs to fix

Function find has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
Open

    public function find($queryString)
    {
        $queryString = trim($queryString);
        if (empty($queryString)) {
            return ['queryString' => $queryString, 'message' => 'No String'];
Severity: Minor
Found in lib/modules/Search/Models/Process.php - About 4 hrs to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function c has 110 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        function c() {
            function e(e, t) {
                var n = this, i, r;
                i = t.getBlob().getSource(), r = new window.FileReader, r.onload = function () {
                    t.append(t.getBlobName(), new o(null, {type: i.type, data: r.result})), f.send.call(n, e, t)
Severity: Major
Found in lib/plugins/plupload/js/plupload.full.min.js - About 4 hrs to fix

Function fill has 110 lines of code (exceeds 25 allowed). Consider refactoring.
Open

                        fill: function() {
                            var d = new Date(this.viewDate),
                                    year = d.getUTCFullYear(),
                                    month = d.getUTCMonth(),
                                    startYear = this.o.startDate !== -Infinity ? this.o.startDate.getUTCFullYear() : -Infinity,
Severity: Major
Found in lib/plugins/bootstrap-datepicker/js/bootstrap-datepicker.js - About 4 hrs to fix

Function updateResults has 110 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        updateResults: function (initial) {
            var search = this.search,
                results = this.results,
                opts = this.opts,
                data,
Severity: Major
Found in lib/plugins/select2/select2.js - About 4 hrs to fix
Severity
Category
Status
Source
Language