XoopsModules25x/apcal

View on GitHub

Showing 26,336 of 26,336 total issues

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

            foreach ($phpinfo_array as $line) {
                $line = trim(strip_tags($line));
                foreach ($gd_info as $key => $value) {
                    //if (strpos($line, $key) !== false) {
                    if (strpos($line, $key) === 0) {
Severity: Minor
Found in thumbs/phpthumb.functions.php and 1 other location - About 35 mins to fix
thumbs/phpthumb.functions.php on lines 202..210

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

                if ($event->gmlat > 0 || $event->gmlong > 0) {
                    $this->gmPoints[] = array(
                        'summary'   => $event->summary,
                        'gmlat'     => $event->gmlat,
                        'gmlong'    => $event->gmlong,
Severity: Minor
Found in class/APCal_xoops.php and 1 other location - About 35 mins to fix
class/APCal.php on lines 2110..2120

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

                    case 'clr': // Colorize
                        if (phpthumb_functions::gd_version() < 2) {
                            $this->DebugMessage('Skipping Colorize() because gd_version is "' . phpthumb_functions::gd_version() . '"', __FILE__, __LINE__);
                            break;
                        }
Severity: Minor
Found in thumbs/phpthumb.class.php and 1 other location - About 35 mins to fix
thumbs/phpthumb.class.php on lines 3038..3045

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

        getParam: function (a, param) {
            a.getParams = a.onclick;
            var p = a.getParams ? a.getParams() : null;
            a.getParams = null;

Severity: Minor
Found in assets/images/js/highslide/highslide-full.js - About 35 mins 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 deletePic has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

function deletePic(url, p, e, m, n) {
    var xmlhttp = window.XMLHttpRequest ? new XMLHttpRequest() : new ActiveXObject("Microsoft.XMLHTTP"); //IF ie7+, FF, Chrome, Opera, Safari, ... ELSE IE6, IE5

    xmlhttp.onreadystatechange = function () {
        if (xmlhttp.readyState == 4 && xmlhttp.status == 200 && xmlhttp.responseText > -1) {
Severity: Minor
Found in ajax/pictures.js - About 35 mins 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 dayMouseOver has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

Calendar.dayMouseOver = function (ev) {
    var el = Calendar.getElement(ev);
    if (Calendar.isRelated(el, ev) || Calendar._C || el.disabled) {
        return false;
    }
Severity: Minor
Found in assets/js/jscalendar/calendar.js - About 35 mins 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 getExpander has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

        getExpander: function (el, expOnly) {
            if (typeof el == 'undefined') return hs.expanders[hs.focusKey] || null;
            if (typeof el == 'number') return hs.expanders[el] || null;
            if (typeof el == 'string') el = hs.$(el);
            return hs.expanders[hs.getWrapperKey(el, expOnly)] || null;
Severity: Minor
Found in assets/images/js/highslide/highslide-full.js - About 35 mins 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 htmlGetSize has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

        htmlGetSize: function () {
            if (this.iframe && !this.objectHeight) { // loadtime before
                this.iframe.style.height = this.body.style.height = this.getIframePageHeight() + 'px';
            }
            this.innerContent.appendChild(hs.clearing);
Severity: Minor
Found in assets/images/js/highslide/highslide-full.js - About 35 mins 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 destroyObject has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

        destroyObject: function () {
            if (hs.ie && this.iframe)
                try {
                    this.iframe.contentWindow.document.body.innerHTML = '';
                } catch (e) {
Severity: Minor
Found in assets/images/js/highslide/highslide-full.js - About 35 mins 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 showMonthsCombo has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

Calendar.showMonthsCombo = function () {
    var cal = Calendar._C;
    if (!cal) {
        return false;
    }
Severity: Minor
Found in assets/js/jscalendar/calendar.js - About 35 mins 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 isRelated has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

Calendar.isRelated = function (el, evt) {
    var related = evt.relatedTarget;
    if (!related) {
        var type = evt.type;
        if (type == "mouseover") {
Severity: Minor
Found in assets/js/jscalendar/calendar.js - About 35 mins 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 _toggleMultipleDate has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

Calendar.prototype._toggleMultipleDate = function (date) {
    if (this.multiple) {
        var ds = date.print("%Y%m%d");
        var cell = this.datesCells[ds];
        if (cell) {
Severity: Minor
Found in assets/js/jscalendar/calendar.js - About 35 mins 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 getParam has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

        getParam: function (a, param) {
            a.getParams = a.onclick;
            var p = a.getParams ? a.getParams() : null;
            a.getParams = null;

Severity: Minor
Found in assets/images/js/highslide/highslide-with-gallery.js - About 35 mins 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 getParam has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

        getParam: function (a, param) {
            a.getParams = a.onclick;
            var p = a.getParams ? a.getParams() : null;
            a.getParams = null;

Severity: Minor
Found in assets/images/js/highslide/highslide-with-html.js - About 35 mins 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 resize has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

        resize: function (e) {
            var w, h, r = e.width / e.height;
            w = Math.max(e.width + e.dX, Math.min(this.minWidth, this.x.full));
            if (this.isImage && Math.abs(w - this.x.full) < 12) w = this.x.full;
            h = w / r;
Severity: Minor
Found in assets/images/js/highslide/highslide.js - About 35 mins 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 htmlGetSize has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

        htmlGetSize: function () {
            if (this.iframe && !this.objectHeight) { // loadtime before
                this.iframe.style.height = this.body.style.height = this.getIframePageHeight() + 'px';
            }
            this.innerContent.appendChild(hs.clearing);
Severity: Minor
Found in assets/images/js/highslide/highslide-with-html.js - About 35 mins 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 getParam has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

        getParam: function (a, param) {
            a.getParams = a.onclick;
            var p = a.getParams ? a.getParams() : null;
            a.getParams = null;

Severity: Minor
Found in assets/images/js/highslide/highslide.js - About 35 mins 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 resize has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

        resize: function (e) {
            var w, h, r = e.width / e.height;
            w = Math.max(e.width + e.dX, Math.min(this.minWidth, this.x.full));
            if (this.isImage && Math.abs(w - this.x.full) < 12) w = this.x.full;
            h = w / r;
Severity: Minor
Found in assets/images/js/highslide/highslide-with-gallery.js - About 35 mins 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 getExpander has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

        getExpander: function (el, expOnly) {
            if (typeof el == 'undefined') return hs.expanders[hs.focusKey] || null;
            if (typeof el == 'number') return hs.expanders[el] || null;
            if (typeof el == 'string') el = hs.$(el);
            return hs.expanders[hs.getWrapperKey(el, expOnly)] || null;
Severity: Minor
Found in assets/images/js/highslide/highslide.js - About 35 mins 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 close has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

        close: function () {
            if (this.isClosing || !this.isExpanded) return;
            this.isClosing = true;

            hs.removeEventListener(document, window.opera ? 'keypress' : 'keydown', hs.keyHandler);
Severity: Minor
Found in assets/images/js/highslide/highslide.js - About 35 mins 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

Severity
Category
Status
Source
Language