mambax7/extcal

View on GitHub

Showing 1,163 of 1,163 total issues

Identical blocks of code found in 2 locations. 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;
            try {
                new hs.Expander(a, params, custom);
Severity: Major
Found in assets/js/highslide-with-gallery.js and 1 other location - About 3 hrs to fix
assets/js/highslide.js on lines 218..227

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

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

        correctRatio: function (ratio) {
            var x = this.x,
                y = this.y,
                changed = false,
                xSize = Math.min(x.full, x.size),
Severity: Minor
Found in assets/js/highslide-full.js - About 3 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 initSlideshow has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

        initSlideshow: function () {
            if (!this.last) {
                for (var i = 0; i < hs.slideshows.length; i++) {
                    var ss = hs.slideshows[i], sg = ss.slideshowGroup;
                    if (typeof sg == 'undefined' || sg === null || sg === this.slideshowGroup)
Severity: Minor
Found in assets/js/highslide-full.js - About 3 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 correctRatio has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

        correctRatio: function (ratio) {
            var x = this.x,
                y = this.y,
                changed = false,
                xSize = Math.min(x.full, x.size),
Severity: Minor
Found in assets/js/highslide.js - About 3 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 correctRatio has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

        correctRatio: function (ratio) {
            var x = this.x,
                y = this.y,
                changed = false,
                xSize = Math.min(x.full, x.size),
Severity: Minor
Found in assets/js/highslide-with-gallery.js - About 3 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 initSlideshow has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

        initSlideshow: function () {
            if (!this.last) {
                for (var i = 0; i < hs.slideshows.length; i++) {
                    var ss = hs.slideshows[i], sg = ss.slideshowGroup;
                    if (typeof sg == 'undefined' || sg === null || sg === this.slideshowGroup)
Severity: Minor
Found in assets/js/highslide-with-gallery.js - About 3 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

Method PclTarHandleAddFile has 77 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    function PclTarHandleAddFile($p_tar, $p_filename, $p_mode, &$p_header, $p_add_dir, $p_remove_dir)
    {
        TrFctStart(__FILE__, __LINE__, 'PclTarHandleAddFile', "tar='$p_tar', filename='$p_filename', p_mode='$p_mode', add_dir='$p_add_dir', remove_dir='$p_remove_dir'");
        $v_result = 1;

Severity: Major
Found in class/pcltar.lib.php - About 3 hrs to fix

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

                var overlay = hs.createElement(
                    'div', {
                        id: 'hsId' + hs.idCounter++,
                        hsId: o.hsId
                    }, {
    Severity: Major
    Found in assets/js/highslide-full.js and 1 other location - About 3 hrs to fix
    assets/js/highslide-with-gallery.js on lines 2123..2136

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

    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

                var overlay = hs.createElement(
                    'div', {
                        id: 'hsId' + hs.idCounter++,
                        hsId: o.hsId
                    }, {
    Severity: Major
    Found in assets/js/highslide-with-gallery.js and 1 other location - About 3 hrs to fix
    assets/js/highslide-full.js on lines 2705..2718

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

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

                case '-1MO':
    
                    $ts        = \mktime(0, 0, 0, $month, \date('t', \mktime(0, 0, 0, $month, 1, $year)), $year);
                    $dayOfWeek = \date('w', $ts);
                    $i         = 0;
    Severity: Major
    Found in class/EventHandler.php and 6 other locations - About 3 hrs to fix
    class/EventHandler.php on lines 2059..2073
    class/EventHandler.php on lines 2089..2103
    class/EventHandler.php on lines 2104..2118
    class/EventHandler.php on lines 2119..2133
    class/EventHandler.php on lines 2134..2148
    class/EventHandler.php on lines 2149..2163

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

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

                case '-1SU':
    
                    $ts        = \mktime(0, 0, 0, $month, \date('t', \mktime(0, 0, 0, $month, 1, $year)), $year);
                    $dayOfWeek = \date('w', $ts);
                    $i         = 0;
    Severity: Major
    Found in class/EventHandler.php and 6 other locations - About 3 hrs to fix
    class/EventHandler.php on lines 2074..2088
    class/EventHandler.php on lines 2089..2103
    class/EventHandler.php on lines 2104..2118
    class/EventHandler.php on lines 2119..2133
    class/EventHandler.php on lines 2134..2148
    class/EventHandler.php on lines 2149..2163

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

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

                case '-1TU':
    
                    $ts        = \mktime(0, 0, 0, $month, \date('t', \mktime(0, 0, 0, $month, 1, $year)), $year);
                    $dayOfWeek = \date('w', $ts);
                    $i         = 0;
    Severity: Major
    Found in class/EventHandler.php and 6 other locations - About 3 hrs to fix
    class/EventHandler.php on lines 2059..2073
    class/EventHandler.php on lines 2074..2088
    class/EventHandler.php on lines 2104..2118
    class/EventHandler.php on lines 2119..2133
    class/EventHandler.php on lines 2134..2148
    class/EventHandler.php on lines 2149..2163

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

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

                case '-1WE':
    
                    $ts        = \mktime(0, 0, 0, $month, \date('t', \mktime(0, 0, 0, $month, 1, $year)), $year);
                    $dayOfWeek = \date('w', $ts);
                    $i         = 0;
    Severity: Major
    Found in class/EventHandler.php and 6 other locations - About 3 hrs to fix
    class/EventHandler.php on lines 2059..2073
    class/EventHandler.php on lines 2074..2088
    class/EventHandler.php on lines 2089..2103
    class/EventHandler.php on lines 2119..2133
    class/EventHandler.php on lines 2134..2148
    class/EventHandler.php on lines 2149..2163

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

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

                case '-1TH':
    
                    $ts        = \mktime(0, 0, 0, $month, \date('t', \mktime(0, 0, 0, $month, 1, $year)), $year);
                    $dayOfWeek = \date('w', $ts);
                    $i         = 0;
    Severity: Major
    Found in class/EventHandler.php and 6 other locations - About 3 hrs to fix
    class/EventHandler.php on lines 2059..2073
    class/EventHandler.php on lines 2074..2088
    class/EventHandler.php on lines 2089..2103
    class/EventHandler.php on lines 2104..2118
    class/EventHandler.php on lines 2134..2148
    class/EventHandler.php on lines 2149..2163

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

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

                case '-1SA':
    
                    $ts        = \mktime(0, 0, 0, $month, \date('t', \mktime(0, 0, 0, $month, 1, $year)), $year);
                    $dayOfWeek = \date('w', $ts);
                    $i         = 0;
    Severity: Major
    Found in class/EventHandler.php and 6 other locations - About 3 hrs to fix
    class/EventHandler.php on lines 2059..2073
    class/EventHandler.php on lines 2074..2088
    class/EventHandler.php on lines 2089..2103
    class/EventHandler.php on lines 2104..2118
    class/EventHandler.php on lines 2119..2133
    class/EventHandler.php on lines 2134..2148

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

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

                case '-1FR':
    
                    $ts        = \mktime(0, 0, 0, $month, \date('t', \mktime(0, 0, 0, $month, 1, $year)), $year);
                    $dayOfWeek = \date('w', $ts);
                    $i         = 0;
    Severity: Major
    Found in class/EventHandler.php and 6 other locations - About 3 hrs to fix
    class/EventHandler.php on lines 2059..2073
    class/EventHandler.php on lines 2074..2088
    class/EventHandler.php on lines 2089..2103
    class/EventHandler.php on lines 2104..2118
    class/EventHandler.php on lines 2119..2133
    class/EventHandler.php on lines 2149..2163

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

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

    function xoops_module_update_extcal(\XoopsModule $module, $previousVersion = null)
    {
        //    global $xoopsDB;
        $moduleDirName = \basename(\dirname(__DIR__));
    
    
    Severity: Major
    Found in include/onupdate.php - About 3 hrs to fix

      FormSpin has 26 functions (exceeds 20 allowed). Consider refactoring.
      Open

      class FormSpin extends \XoopsFormElement
      {
          /**
           * Value.
           *
      Severity: Minor
      Found in class/Form/Spin/FormSpin.php - About 3 hrs to fix

        Function Expander has 75 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            hs.Expander = function (a, params, custom, contentType) {
                if (document.readyState && hs.ie && !hs.isReady) {
                    hs.addEventListener(document, 'ready', function () {
                        new hs.Expander(a, params, custom, contentType);
                    });
        Severity: Major
        Found in assets/js/highslide.js - About 3 hrs to fix

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

                      if (isNew) {
                          if (hs.geckoMac && hs.dimmingGeckoFix)
                              hs.setStyles(hs.dimmer, {
                                  background: 'url(' + hs.graphicsDir + 'geckodimmer.png)',
                                  opacity: 1
          Severity: Major
          Found in assets/js/highslide-with-gallery.js and 1 other location - About 2 hrs to fix
          assets/js/highslide-full.js on lines 544..552

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

          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