XoopsModules25x/apcal

View on GitHub

Showing 26,336 of 26,336 total issues

File Text_Diff.php has 484 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

/**
 * Text_Diff
 *
Severity: Minor
Found in include/Text_Diff.php - About 7 hrs to fix

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

            showLoading: function () {
                if (this.onLoadStarted || this.loading) return;
    
                this.loading = hs.loading;
                var exp = this;
    Severity: Major
    Found in assets/images/js/highslide/highslide.js and 1 other location - About 7 hrs to fix
    assets/images/js/highslide/highslide-with-html.js on lines 1269..1284

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

    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

            showLoading: function () {
                if (this.onLoadStarted || this.loading) return;
    
                this.loading = hs.loading;
                var exp = this;
    Severity: Major
    Found in assets/images/js/highslide/highslide-with-html.js and 1 other location - About 7 hrs to fix
    assets/images/js/highslide/highslide.js on lines 1088..1103

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

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

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

            mouseClickHandler: function (e) {
                if (!e) e = window.event;
                if (e.button > 1) return true;
                if (!e.target) e.target = e.srcElement;
    
    
    Severity: Minor
    Found in assets/images/js/highslide/highslide-with-html.js - About 7 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 startElementHandler has a Cognitive Complexity of 49 (exceeds 5 allowed). Consider refactoring.
    Open

            public function startElementHandler($fname, $tagname, $attributes, $line, $lineno)
            {
                //  check for whitespace attribute
                if ($attributes['whitespace']) {
                    array_push($this->whitespace, strtolower($attributes['whitespace']));
    Severity: Minor
    Found in include/patTemplate.php - About 7 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

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

                if (exp.iframe) {
                    if (!exp.releaseMask) exp.releaseMask = hs.createElement('div', null,
                        {
                            position: 'absolute',
                            width: exp.x.size + 'px',
    Severity: Major
    Found in assets/images/js/highslide/highslide-with-html.js and 1 other location - About 7 hrs to fix
    assets/images/js/highslide/highslide-full.js on lines 794..809

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

    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

                if (exp.iframe) {
                    if (!exp.releaseMask) exp.releaseMask = hs.createElement('div', null,
                        {
                            position: 'absolute',
                            width: exp.x.size + 'px',
    Severity: Major
    Found in assets/images/js/highslide/highslide-full.js and 1 other location - About 7 hrs to fix
    assets/images/js/highslide/highslide-with-html.js on lines 619..634

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

    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

    switch ($tz) {
        case 's':
            $tzoffset  = 0;
            $tzdisp    = ($serverTZ >= 0 ? '+' : '-') . sprintf('%02d:%02d', abs($serverTZ), abs($serverTZ) * 60 % 60);
            $tzoptions = str_replace("'s'>", "'s' selected>", $tzoptions);
    Severity: Major
    Found in admin/events.php and 2 other locations - About 7 hrs to fix
    admin/admission.php on lines 75..92
    admin/icalendar_import.php on lines 66..83

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

    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

    switch ($tz) {
        case 's':
            $tzoffset  = 0;
            $tzdisp    = ($serverTZ >= 0 ? '+' : '-') . sprintf('%02d:%02d', abs($serverTZ), abs($serverTZ) * 60 % 60);
            $tzoptions = str_replace("'s'>", "'s' selected>", $tzoptions);
    Severity: Major
    Found in admin/admission.php and 2 other locations - About 7 hrs to fix
    admin/events.php on lines 100..117
    admin/icalendar_import.php on lines 66..83

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

    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

    switch ($tz) {
        case 's':
            $tzoffset  = 0;
            $tzdisp    = ($serverTZ >= 0 ? '+' : '-') . sprintf('%02d:%02d', abs($serverTZ), abs($serverTZ) * 60 % 60);
            $tzoptions = str_replace("'s'>", "'s' selected>", $tzoptions);
    Severity: Major
    Found in admin/icalendar_import.php and 2 other locations - About 7 hrs to fix
    admin/admission.php on lines 75..92
    admin/events.php on lines 100..117

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

    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

    prototype has 53 functions (exceeds 20 allowed). Consider refactoring.
    Open

        hs.Expander.prototype = {
            error: function (e) {
                if (hs.debug) alert('Line ' + e.lineNumber + ': ' + e.message);
                else window.location.href = this.src;
            },
    Severity: Major
    Found in assets/images/js/highslide/highslide-full.js - About 7 hrs to fix

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

              css: function (el, prop) {
                  if (el.style[prop]) {
                      return el.style[prop];
                  } else if (document.defaultView) {
                      return document.defaultView.getComputedStyle(el, null).getPropertyValue(prop);
      Severity: Major
      Found in assets/images/js/highslide/highslide-with-html.js and 3 other locations - About 7 hrs to fix
      assets/images/js/highslide/highslide-full.js on lines 278..296
      assets/images/js/highslide/highslide-with-gallery.js on lines 232..250
      assets/images/js/highslide/highslide.js on lines 167..185

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

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

              css: function (el, prop) {
                  if (el.style[prop]) {
                      return el.style[prop];
                  } else if (document.defaultView) {
                      return document.defaultView.getComputedStyle(el, null).getPropertyValue(prop);
      Severity: Major
      Found in assets/images/js/highslide/highslide-with-gallery.js and 3 other locations - About 7 hrs to fix
      assets/images/js/highslide/highslide-full.js on lines 278..296
      assets/images/js/highslide/highslide-with-html.js on lines 228..246
      assets/images/js/highslide/highslide.js on lines 167..185

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

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

              css: function (el, prop) {
                  if (el.style[prop]) {
                      return el.style[prop];
                  } else if (document.defaultView) {
                      return document.defaultView.getComputedStyle(el, null).getPropertyValue(prop);
      Severity: Major
      Found in assets/images/js/highslide/highslide-full.js and 3 other locations - About 7 hrs to fix
      assets/images/js/highslide/highslide-with-gallery.js on lines 232..250
      assets/images/js/highslide/highslide-with-html.js on lines 228..246
      assets/images/js/highslide/highslide.js on lines 167..185

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

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

              css: function (el, prop) {
                  if (el.style[prop]) {
                      return el.style[prop];
                  } else if (document.defaultView) {
                      return document.defaultView.getComputedStyle(el, null).getPropertyValue(prop);
      Severity: Major
      Found in assets/images/js/highslide/highslide.js and 3 other locations - About 7 hrs to fix
      assets/images/js/highslide/highslide-full.js on lines 278..296
      assets/images/js/highslide/highslide-with-gallery.js on lines 232..250
      assets/images/js/highslide/highslide-with-html.js on lines 228..246

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

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

      function xoops_module_update_apcal(XoopsModule $module)
      {
          //    global $xoopsDB;
          $moduleDirName = basename(dirname(__DIR__));
          $capsDirName   = strtoupper($moduleDirName);
      Severity: Minor
      Found in include/onupdate.php - About 7 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 list_blocks has a Cognitive Complexity of 48 (exceeds 5 allowed). Consider refactoring.
      Open

      function list_blocks()
      {
          global $query4redirect, $block_arr, $xoopsGTicket;
      
          // cachetime options
      Severity: Minor
      Found in admin/myblocksadmin.php - About 7 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 rrule_to_human_language has a Cognitive Complexity of 48 (exceeds 5 allowed). Consider refactoring.
      Open

              public function rrule_to_human_language($rrule)
              {
                  $rrule = trim($rrule);
                  if ($rrule === '') {
                      return '';
      Severity: Minor
      Found in class/APCal.php - About 7 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

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

              if (!this.outlineType
                  || (this.last && this.isImage && this.transitions[1] == 'crossfade')) {
                  this[this.contentType + 'Create']();
      
              } else if (hs.pendingOutlines[this.outlineType]) {
      Severity: Major
      Found in assets/images/js/highslide/highslide-full.js and 1 other location - About 7 hrs to fix
      assets/images/js/highslide/highslide-with-gallery.js on lines 1243..1260

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

      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