mambax7/extcal

View on GitHub

Showing 1,163 of 1,163 total issues

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

            while (false !== ($myrow = $xoopsDB->fetchArray($result))) {
                $ret[$i]['image'] = 'assets/images/icons/extcal.gif';
                $ret[$i]['link']  = 'event.php?event=' . $myrow['event_id'];
                $ret[$i]['title'] = $myrow['event_title'];
                $ret[$i]['time']  = $myrow['event_submitdate'];
Severity: Major
Found in class/EventHandler.php and 1 other location - About 2 hrs to fix
class/EventHandler.php on lines 2347..2354

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

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 ($v_listing || $v_extract_file || $v_extraction_stopped) {
                TrFctMessage(__FILE__, __LINE__, 2, 'Memorize info about file ' . $v_header['filename'] . '');

                // ----- Log extracted files
                if (($v_file_dir = \dirname($v_header['filename'])) == $v_header['filename']) {
Severity: Major
Found in class/pcltar.lib.php and 1 other location - About 2 hrs to fix
class/pcltar.lib.php on lines 2505..2521

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

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 ($v_extract_file) {
                TrFctMessage(__FILE__, __LINE__, 2, 'Memorize info about file ' . $v_header['filename'] . '');

                // ----- Log extracted files
                if (($v_file_dir = \dirname($v_header['filename'])) == $v_header['filename']) {
Severity: Major
Found in class/pcltar.lib.php and 1 other location - About 2 hrs to fix
class/pcltar.lib.php on lines 2241..2257

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

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

        while (false !== ($myrow = $xoopsDB->fetchArray($result))) {
            $ret[$i]['image'] = 'assets/images/icons/extcal.gif';
            $ret[$i]['link']  = 'event.php?event=' . $myrow['event_id'];
            $ret[$i]['title'] = $myrow['event_title'];
            $ret[$i]['time']  = $myrow['event_submitdate'];
Severity: Major
Found in class/EventHandler.php and 1 other location - About 2 hrs to fix
class/EventHandler.php on lines 2446..2453

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

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

Method loadImg has 49 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public static function loadImg($REQUEST, &$event_picture1, &$event_picture2)
    {
        ///////////////////////////////////////////////////////////////////////////////
        $uploaddir_event = XOOPS_ROOT_PATH . '/uploads/extcal/';
        $uploadurl_event = XOOPS_URL . '/uploads/extcal/';
Severity: Minor
Found in class/Utility.php - About 1 hr to fix

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

            this.wrapper = hs.createElement(
                'div', {
                    id: 'highslide-wrapper-' + this.key,
                    className: 'highslide-wrapper ' + this.wrapperClassName
                }, {
    Severity: Major
    Found in assets/js/highslide-full.js and 2 other locations - About 1 hr to fix
    assets/js/highslide-with-gallery.js on lines 1228..1236
    assets/js/highslide.js on lines 1040..1048

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

    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

            this.wrapper = hs.createElement(
                'div', {
                    id: 'highslide-wrapper-' + this.key,
                    className: 'highslide-wrapper ' + this.wrapperClassName
                }, {
    Severity: Major
    Found in assets/js/highslide-with-gallery.js and 2 other locations - About 1 hr to fix
    assets/js/highslide-full.js on lines 1425..1433
    assets/js/highslide.js on lines 1040..1048

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

    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

            this.wrapper = hs.createElement(
                'div', {
                    id: 'highslide-wrapper-' + this.key,
                    className: 'highslide-wrapper ' + this.wrapperClassName
                }, {
    Severity: Major
    Found in assets/js/highslide.js and 2 other locations - About 1 hr to fix
    assets/js/highslide-full.js on lines 1425..1433
    assets/js/highslide-with-gallery.js on lines 1228..1236

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

    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 (this.dim == 'x' && exp.slideshow && exp.isImage) {
                    if (i == this.full) exp.slideshow.disable('full-expand');
                    else exp.slideshow.enable('full-expand');
                }
    Severity: Major
    Found in assets/js/highslide-full.js and 1 other location - About 1 hr to fix
    assets/js/highslide-with-gallery.js on lines 1153..1156

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

    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 (this.dim == 'x' && exp.slideshow && exp.isImage) {
                    if (i == this.full) exp.slideshow.disable('full-expand');
                    else exp.slideshow.enable('full-expand');
                }
    Severity: Major
    Found in assets/js/highslide-with-gallery.js and 1 other location - About 1 hr to fix
    assets/js/highslide-full.js on lines 1347..1350

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

    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

    Method extcal_getDefautminicalOption has 48 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function extcal_getDefautminicalOption(&$options)
    {
        // 0|0|150|225|1|3|10|0|1|1,2|| |120|120
        for ($h = 0; $h <= 13; ++$h) {
            if (!isset($options[$h])) {
    Severity: Minor
    Found in blocks/minical.php - About 1 hr to fix

      Method PclTarHandleExtractByIndexList has 48 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          function PclTarHandleExtractByIndexList(
              $p_tarname,
              $p_index_string,
              &$p_list_detail,
              $p_path,
      Severity: Minor
      Found in class/pcltar.lib.php - About 1 hr to fix

        Function getPosition has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
        Open

                getPosition: function (el) {
                    if (/area/i.test(el.tagName)) {
                        var imgs = document.getElementsByTagName('img');
                        for (var i = 0; i < imgs.length; i++) {
                            var u = imgs[i].useMap;
        Severity: Minor
        Found in assets/js/highslide-full.js - 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 expand has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
        Open

                expand: function (a, params, custom, type) {
                    if (!a) a = hs.createElement('a', null, {display: 'none'}, hs.container);
                    if (typeof a.getParams == 'function') return params;
                    if (type == 'html') {
                        for (var i = 0; i < hs.sleeping.length; i++) {
        Severity: Minor
        Found in assets/js/highslide-full.js - 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 init has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
        Open

                init: function () {
                    if (!hs.container) {
        
                        hs.ieLt7 = hs.ie && hs.uaVersion < 7;
                        hs.ieLt9 = hs.ie && hs.uaVersion < 9;
        Severity: Minor
        Found in assets/js/highslide-full.js - 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 destroyOverlays has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
        Open

                destroyOverlays: function () {
                    if (!this.overlays.length) return;
                    if (this.slideshow) {
                        var c = this.slideshow.controls;
                        if (c && hs.getExpander(c) == this) c.parentNode.removeChild(c);
        Severity: Minor
        Found in assets/js/highslide-full.js - 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 calcExpanded has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
        Open

                calcExpanded: function () {
                    var exp = this.exp;
                    this.justify = 'auto';
        
                    // get alignment
        Severity: Minor
        Found in assets/js/highslide-full.js - 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 awake has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
        Open

                awake: function () {
                    try {
        
                        hs.expanders[this.key] = this;
        
        
        Severity: Minor
        Found in assets/js/highslide-full.js - 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 init has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
        Open

                init: function () {
                    if (!hs.container) {
        
                        hs.ieLt7 = hs.ie && hs.uaVersion < 7;
                        hs.ieLt9 = hs.ie && hs.uaVersion < 9;
        Severity: Minor
        Found in assets/js/highslide-with-gallery.js - 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 calcExpanded has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
        Open

                calcExpanded: function () {
                    var exp = this.exp;
                    this.justify = 'auto';
        
                    // get alignment
        Severity: Minor
        Found in assets/js/highslide-with-gallery.js - 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

        Severity
        Category
        Status
        Source
        Language