smartinmedia/cunity

View on GitHub

Showing 617 of 617 total issues

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

                        updateNavArrows: function() {
                            if (!this._allow_update)
                                return;

                            var d = new Date(this.viewDate),
Severity: Minor
Found in lib/plugins/bootstrap-datepicker/js/bootstrap-datepicker.js - About 1 hr to fix

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

function loadConversations() {
    sendRequest({}, "messages", "load", function (res) {
        if (typeof res.conversations !== "undefined" && res.conversations !== null && res.conversations.length > 0) {
            $(".inbox-empty,.inbox-loader").hide();
            $(".inbox-item").remove();
Severity: Minor
Found in lib/modules/Messages/styles/javascript/inbox.js - About 1 hr to fix

Method loadData has 36 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    protected function loadData()
    {
        $statisticData = [];
        $statistics = new \Cunity\Admin\Models\Db\Table\Statistics();
        $data = $statistics->getLastMonths();
Severity: Minor
Found in lib/modules/Admin/Models/Pages/Statistics.php - About 1 hr to fix

Method crop has 36 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function crop($x, $y, $x1, $y1, $file, $target, $thumbwidth)
    {
        list(, , $type) = getimagesize($file);

        $source = false;
Severity: Minor
Found in lib/Skoch/Filter/File/Adapter/Gd.php - About 1 hr to fix

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

        $query = $this->getAdapter()->select()->from(['p' => $this->_dbprefix.'posts'])
            ->join(['w' => $this->getTableName()], 'w.wall_id=p.wall_id')
            ->join(['u' => $this->_dbprefix.'users'], 'u.userid=p.userid', ['name', 'username'])
            ->joinLeft(['img' => $this->_dbprefix.'gallery_images'], "img.id=p.content AND p.type = 'image'", ['filename', 'caption', 'id AS refid'])
            ->joinLeft(['rus' => $this->_dbprefix.'users'], "rus.userid=w.owner_id AND p.userid != w.owner_id AND w.owner_type = 'profile'", ['name AS receivername', 'username AS receiverusername'])
Severity: Major
Found in lib/modules/Newsfeed/Models/Db/Table/Walls.php and 1 other location - About 1 hr to fix
lib/modules/Newsfeed/Models/Db/Table/Walls.php on lines 132..136

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

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

        $query = $this->getAdapter()->select()->from(['p' => $this->_dbprefix.'posts'])
            ->join(['w' => $this->getTableName()], 'w.wall_id=p.wall_id')
            ->join(['u' => $this->_dbprefix.'users'], 'u.userid=p.userid', ['name', 'username'])
            ->joinLeft(['img' => $this->_dbprefix.'gallery_images'], "img.id=p.content AND p.type = 'image'", ['filename', 'caption', 'id AS refid'])
            ->joinLeft(['rus' => $this->_dbprefix.'users'], "w.owner_type = 'profile' AND rus.userid=w.owner_id AND p.userid != w.owner_id AND w.owner_id != ".$ownerid, ['name AS receivername', 'username AS receiverusername'])
Severity: Major
Found in lib/modules/Newsfeed/Models/Db/Table/Walls.php and 1 other location - About 1 hr to fix
lib/modules/Newsfeed/Models/Db/Table/Walls.php on lines 87..91

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

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

    private function handleRequest()
    {
        switch (Request::get('action')) {
            case 'sendTestMail':
                $mail = new Mail();
Severity: Minor
Found in lib/modules/Admin/Models/Pages/Settings.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

Function login has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    private function login()
    {
        if (Post::get('email') === null || Post::get('password') === null) {
            throw new MissingParameter();
        }
Severity: Minor
Found in lib/modules/Register/Models/Process.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

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

        function o(o) {
            function a() {
                for (var e = 0, t, n; e <= u.length;) {
                    if (t = c.SHORT(e += 2), t >= 65472 && 65475 >= t)return e += 5, {
                        height: c.SHORT(e),
Severity: Minor
Found in lib/plugins/plupload/js/plupload.full.min.js - About 1 hr to fix

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

        monitorSource: function () {
            var el = this.opts.element, observer, self = this;

            el.on("change.select2", this.bind(function (e) {
                if (this.opts.element.data("select2-change-triggered") !== true) {
Severity: Minor
Found in lib/plugins/select2/select2.js - About 1 hr to fix

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

    Calendar.prototype._day = function(week, day) {
        this._loadTemplate('month-day');

        var t = {tooltip: '', cal: this};
        var cls = this.options.classes.months.outmonth;
Severity: Minor
Found in lib/plugins/calendar/js/calendar.min.js - About 1 hr to fix

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

    $('a[data-toggle="tab"]').on('show.bs.tab', function (e) {
        $(this).siblings().removeClass("active");
        $(e.target).addClass("active");
    });
Severity: Major
Found in lib/modules/Profile/styles/javascript/profile-edit.js and 2 other locations - About 1 hr to fix
lib/modules/Events/styles/javascript/event-edit.js on lines 25..28
lib/modules/Events/styles/javascript/event.js on lines 2..5

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

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

    $('a[data-toggle="tab"]').on('show.bs.tab', function (e) {
        $(this).siblings().removeClass("active");
        $(e.target).addClass("active");
    });
Severity: Major
Found in lib/modules/Events/styles/javascript/event-edit.js and 2 other locations - About 1 hr to fix
lib/modules/Events/styles/javascript/event.js on lines 2..5
lib/modules/Profile/styles/javascript/profile-edit.js on lines 8..11

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

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

    $('a[data-toggle="tab"]').on('show.bs.tab', function (e) {
        $(this).siblings().removeClass("active");
        $(e.target).addClass("active");
    });
Severity: Major
Found in lib/modules/Events/styles/javascript/event.js and 2 other locations - About 1 hr to fix
lib/modules/Events/styles/javascript/event-edit.js on lines 25..28
lib/modules/Profile/styles/javascript/profile-edit.js on lines 8..11

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

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

            success: function () {
                uploader = new plupload.Uploader({
                    runtimes: 'html5,flash,silverlight,html4',
                    browse_button: 'title-upload',
                    multi_selection: false,
Severity: Minor
Found in lib/modules/Events/styles/javascript/event-edit.js - About 1 hr to fix

Method thumbnail has 34 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function thumbnail($file, $target, $thumbwidth)
    {
        list($width, $height, $type) = getimagesize($file);

        $source = false;
Severity: Minor
Found in lib/Skoch/Filter/File/Adapter/Gd.php - About 1 hr to fix

Method reset has 34 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function reset()
    {
        $error_messages = [];
        $view = new ResetPassword();
        if (Post::get() !== null) {
Severity: Minor
Found in lib/modules/Register/Models/Register.php - About 1 hr to fix

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

        setTimeout: function (a, b, c) {
            var d = this;
            return a && window.setTimeout(function () {
                a.apply(d, b || [])
            }, c || 0)
lib/modules/Gallery/styles/javascript/blueimp-gallery.min.js on lines 329..334

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

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

        onslide: function (a) {
            this.index = a, this.handleSlide(a), this.setTimeout(this.options.onslide, [a, this.slides[a]])
        },
lib/modules/Gallery/styles/javascript/jquery.blueimp-gallery.min.js on lines 270..272

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

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

        setTimeout: function (a, b, c) {
            var d = this;
            return a && window.setTimeout(function () {
                a.apply(d, b || [])
            }, c || 0)
lib/modules/Gallery/styles/javascript/jquery.blueimp-gallery.min.js on lines 277..282

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

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