mambax7/extcal

View on GitHub

Showing 1,163 of 1,163 total issues

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

function xoops_module_update_extcal(\XoopsModule $xoopsModule, $previousVersion = null)
{
    $helper     = Helper::getInstance();
    $newVersion = $helper->getModule()->getVar('version') * 100;
    if ($newVersion == $previousVersion) {
Severity: Minor
Found in include/update_function.php - About 1 hr to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

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

    public function getRecurRules($parm)
    {
        //Utility::echoArray($parm);exit;

        // If this isn't a reccuring event
Severity: Minor
Found in class/EventHandler.php - About 1 hr to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

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

        doShowHide: function (visibility) {
            if (hs.hideSelects) this.showHideElements('SELECT', visibility);
            if (hs.hideIframes) this.showHideElements('IFRAME', visibility);
            if (hs.geckoMac) this.showHideElements('*', visibility);
        },
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 2483..2487
assets/js/highslide.js on lines 1483..1487

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

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

        doShowHide: function (visibility) {
            if (hs.hideSelects) this.showHideElements('SELECT', visibility);
            if (hs.hideIframes) this.showHideElements('IFRAME', visibility);
            if (hs.geckoMac) this.showHideElements('*', visibility);
        },
Severity: Major
Found in assets/js/highslide.js and 2 other locations - About 1 hr to fix
assets/js/highslide-full.js on lines 2483..2487
assets/js/highslide-with-gallery.js on lines 1978..1982

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

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

        doShowHide: function (visibility) {
            if (hs.hideSelects) this.showHideElements('SELECT', visibility);
            if (hs.hideIframes) this.showHideElements('IFRAME', visibility);
            if (hs.geckoMac) this.showHideElements('*', visibility);
        },
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 1978..1982
assets/js/highslide.js on lines 1483..1487

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

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

        htmlSizeOperations: function () {

            this.setObjContainerSize(this.innerContent);


Severity: Minor
Found in assets/js/highslide-full.js - About 1 hr to fix

    Function justify has 47 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            justify: function (p, moveOnly) {
                var tgtArr, tgt = p.target, dim = p == this.x ? 'x' : 'y';
    
                if (tgt && tgt.match(/ /)) {
                    tgtArr = tgt.split(' ');
    Severity: Minor
    Found in assets/js/highslide-full.js - About 1 hr to fix

      Function justify has 47 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              justify: function (p, moveOnly) {
                  var tgtArr, tgt = p.target, dim = p == this.x ? 'x' : 'y';
      
                  if (tgt && tgt.match(/ /)) {
                      tgtArr = tgt.split(' ');
      Severity: Minor
      Found in assets/js/highslide-with-gallery.js - About 1 hr to fix

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

                ready: function () {
                    if (hs.isReady) return;
                    hs.isReady = true;
                    for (var i = 0; i < hs.onReady.length; i++) hs.onReady[i]();
                },
        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 798..802
        assets/js/highslide.js on lines 625..629

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

        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

                ready: function () {
                    if (hs.isReady) return;
                    hs.isReady = true;
                    for (var i = 0; i < hs.onReady.length; i++) hs.onReady[i]();
                },
        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 977..981
        assets/js/highslide.js on lines 625..629

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

        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

                ready: function () {
                    if (hs.isReady) return;
                    hs.isReady = true;
                    for (var i = 0; i < hs.onReady.length; i++) hs.onReady[i]();
                },
        Severity: Major
        Found in assets/js/highslide.js and 2 other locations - About 1 hr to fix
        assets/js/highslide-full.js on lines 977..981
        assets/js/highslide-with-gallery.js on lines 798..802

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

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

                keyHandler: function (e) {
                    if (!e) e = window.event;
                    if (!e.target) e.target = e.srcElement; // ie
                    if (typeof e.target.form != 'undefined') return true; // form element has focus
                    if (!hs.fireEvent(hs, 'onKeyDown', e)) return true;
        Severity: Minor
        Found in assets/js/highslide-full.js - About 1 hr to fix

          Method adjustDate has 46 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function adjustDate(&$y, &$m, &$d, &$h, &$i, &$s)
              {
                  if ($s < 0) {
                      $m -= floor($s / _EXTCAL_TS_MINUTE);
                      $s = -$s % _EXTCAL_TS_MINUTE;
          Severity: Minor
          Found in class/pear/Calendar/Engine/PearDate.php - About 1 hr to fix

            Method addEventToCalArray has 46 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function addEventToCalArray(&$event, &$eventsArray, $startPeriod, $endPeriod)
                {
                    global $timeHandler, $xoopsUser, $month, $year;
            
                    // Calculating the start and the end of the event
            Severity: Minor
            Found in class/EventHandler.php - About 1 hr to fix

              Method getForm has 46 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function getForm($action = false)
                  {
                      global $xoopsDB;
              
                      if (false === $action) {
              Severity: Minor
              Found in class/Location.php - About 1 hr to fix

                Method render has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function render()
                    {
                        $addBaliseTable = $this->_addBaliseTable;
                        $title          = $this->getTitle();
                        $ret            = '';
                Severity: Minor
                Found in class/TableForm.php - About 1 hr to fix

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

                  <?php
                  /**
                   * extcal module.
                   *
                   * You may not change or alter any portion of this comment or credits
                  Severity: Major
                  Found in versions/Extcal_2_37.php and 1 other location - About 1 hr to fix
                  versions/Extcal_2_33.php on lines 1..64

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

                  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

                      public function nextWeekDay($format = 'int')
                      {
                          $ts  = $this->calendar->nextDay('timestamp');
                          $Day = new Calendar_Day(2000, 1, 1);
                          $Day->setTimestamp($ts);
                  Severity: Major
                  Found in class/pear/Calendar/Decorator/Weekday.php and 1 other location - About 1 hr to fix
                  class/pear/Calendar/Decorator/Weekday.php on lines 114..123

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

                  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

                      public function prevWeekDay($format = 'int')
                      {
                          $ts  = $this->calendar->prevDay('timestamp');
                          $Day = new Calendar_Day(2000, 1, 1);
                          $Day->setTimestamp($ts);
                  Severity: Major
                  Found in class/pear/Calendar/Decorator/Weekday.php and 1 other location - About 1 hr to fix
                  class/pear/Calendar/Decorator/Weekday.php on lines 148..157

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

                  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

                  <?php
                  /**
                   * extcal module.
                   *
                   * You may not change or alter any portion of this comment or credits
                  Severity: Major
                  Found in versions/Extcal_2_33.php and 1 other location - About 1 hr to fix
                  versions/Extcal_2_37.php on lines 1..63

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

                  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