XoopsModules25x/apcal

View on GitHub

Showing 26,336 of 26,336 total issues

Function RedirectToCachedFile has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
Open

function RedirectToCachedFile()
{
    global $phpThumb;

    $nice_cachefile = str_replace(DIRECTORY_SEPARATOR, '/', $phpThumb->cache_filename);
Severity: Minor
Found in thumbs/phpThumb.php - About 2 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 (up && this.isHtml) {
                hs.setStyles(this.wrapper, {
                    left: (x.tpos - x.cb + x.tb) + 'px',
                    top: (y.tpos - y.cb + y.tb) + 'px'
                });
Severity: Major
Found in assets/images/js/highslide/highslide-full.js and 1 other location - About 2 hrs to fix
assets/images/js/highslide/highslide-with-html.js on lines 1758..1763

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

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 (up && this.isHtml) {
                hs.setStyles(this.wrapper, {
                    left: (x.tpos - x.cb + x.tb) + 'px',
                    top: (y.tpos - y.cb + y.tb) + 'px'
                });
Severity: Major
Found in assets/images/js/highslide/highslide-with-html.js and 1 other location - About 2 hrs to fix
assets/images/js/highslide/highslide-full.js on lines 2063..2068

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

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

    public function ImageMagickCommandlineBase()
    {
        static $commandline = null;
        if (is_null($commandline)) {
            if ($this->issafemode) {
Severity: Major
Found in thumbs/phpthumb.class.php - About 2 hrs to fix

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

                contentWrapper: '<div class="highslide-header"><ul>' +
                '<li class="highslide-previous">' +
                '<a href="#" title="{hs.lang.previousTitle}" onclick="return hs.previous(this)">' +
                '<span>{hs.lang.previousText}</span></a>' +
                '</li>' +
    Severity: Major
    Found in assets/images/js/highslide/highslide-full.js and 1 other location - About 2 hrs to fix
    assets/images/js/highslide/highslide-with-html.js on lines 72..93

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

    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

                contentWrapper: '<div class="highslide-header"><ul>' +
                '<li class="highslide-previous">' +
                '<a href="#" title="{hs.lang.previousTitle}" onclick="return hs.previous(this)">' +
                '<span>{hs.lang.previousText}</span></a>' +
                '</li>' +
    Severity: Major
    Found in assets/images/js/highslide/highslide-with-html.js and 1 other location - About 2 hrs to fix
    assets/images/js/highslide/highslide-full.js on lines 112..133

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

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

        function apcal_mini_calendar_show($options)
        {
            global $xoopsConfig, $xoopsDB, $xoopsUser;
    
            $moduleDirName = empty($options[0]) ? basename(dirname(__DIR__)) : $options[0];
    Severity: Major
    Found in blocks/apcal_mini_calendar.php - About 2 hrs to fix

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

                      hs.loading = hs.createElement('a', {
                              className: 'highslide-loading',
                              title: hs.lang.loadingTitle,
                              innerHTML: hs.lang.loadingText,
                              href: 'javascript:;'
      Severity: Major
      Found in assets/images/js/highslide/highslide.js and 3 other locations - About 2 hrs to fix
      assets/images/js/highslide/highslide-full.js on lines 938..949
      assets/images/js/highslide/highslide-with-gallery.js on lines 762..773
      assets/images/js/highslide/highslide-with-html.js on lines 761..772

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

      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

                      hs.loading = hs.createElement('a', {
                              className: 'highslide-loading',
                              title: hs.lang.loadingTitle,
                              innerHTML: hs.lang.loadingText,
                              href: 'javascript:;'
      Severity: Major
      Found in assets/images/js/highslide/highslide-with-gallery.js and 3 other locations - About 2 hrs to fix
      assets/images/js/highslide/highslide-full.js on lines 938..949
      assets/images/js/highslide/highslide-with-html.js on lines 761..772
      assets/images/js/highslide/highslide.js on lines 598..609

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

      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

                      hs.loading = hs.createElement('a', {
                              className: 'highslide-loading',
                              title: hs.lang.loadingTitle,
                              innerHTML: hs.lang.loadingText,
                              href: 'javascript:;'
      Severity: Major
      Found in assets/images/js/highslide/highslide-with-html.js and 3 other locations - About 2 hrs to fix
      assets/images/js/highslide/highslide-full.js on lines 938..949
      assets/images/js/highslide/highslide-with-gallery.js on lines 762..773
      assets/images/js/highslide/highslide.js on lines 598..609

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

      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

                      hs.loading = hs.createElement('a', {
                              className: 'highslide-loading',
                              title: hs.lang.loadingTitle,
                              innerHTML: hs.lang.loadingText,
                              href: 'javascript:;'
      Severity: Major
      Found in assets/images/js/highslide/highslide-full.js and 3 other locations - About 2 hrs to fix
      assets/images/js/highslide/highslide-with-gallery.js on lines 762..773
      assets/images/js/highslide/highslide-with-html.js on lines 761..772
      assets/images/js/highslide/highslide.js on lines 598..609

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

      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 (mon) {
              date = new Date(cal.date);
              if (mon.month != date.getMonth()) {
                  date.setMonth(mon.month);
                  cal.setDate(date);
      Severity: Major
      Found in assets/js/jscalendar/calendar.js and 1 other location - About 2 hrs to fix
      assets/js/jscalendar/calendar.js on lines 360..368

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

      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 (year) {
                  date = new Date(cal.date);
                  if (year.year != date.getFullYear()) {
                      date.setFullYear(year.year);
                      cal.setDate(date);
      Severity: Major
      Found in assets/js/jscalendar/calendar.js and 1 other location - About 2 hrs to fix
      assets/js/jscalendar/calendar.js on lines 350..369

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

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

              contentLoaded: function () {
                  try {
                      if (!this.content) return;
                      this.content.onload = null;
                      if (this.onLoadStarted) return;
      Severity: Major
      Found in assets/images/js/highslide/highslide-full.js - About 2 hrs to fix

        Function positionOverlay has 66 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                positionOverlay: function (overlay) {
                    var p = overlay.position || 'middle center',
                        relToVP = (overlay.relativeTo == 'viewport'),
                        offX = overlay.offsetX,
                        offY = overlay.offsetY;
        Severity: Major
        Found in assets/images/js/highslide/highslide-with-gallery.js - About 2 hrs to fix

          Function positionOverlay has 66 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  positionOverlay: function (overlay) {
                      var p = overlay.position || 'middle center',
                          relToVP = (overlay.relativeTo == 'viewport'),
                          offX = overlay.offsetX,
                          offY = overlay.offsetY;
          Severity: Major
          Found in assets/images/js/highslide/highslide-full.js - About 2 hrs to fix

            Method DropShadow has 66 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function DropShadow(&$gdimg, $distance, $width, $hexcolor, $angle, $alpha)
                {
                    if (phpthumb_functions::gd_version() < 2) {
                        return false;
                    }
            Severity: Major
            Found in thumbs/phpthumb.filters.php - About 2 hrs to fix

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

                      echo "
                      <tr valign='middle'>
                          <td class='$class'>
                              $name
                              <br>
              Severity: Major
              Found in admin/myblocksadmin2.php and 1 other location - About 2 hrs to fix
              admin/myblocksadmin.php on lines 239..286

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

              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

                                                      case 2:
                                                          // delta - The 2 bytes following the escape contain unsigned values
                                                          // indicating the horizontal and vertical offsets of the next pixel
                                                          // from the current position.
                                                          $colincrement = $this->LittleEndian2Int(substr($BMPpixelData, $pixeldataoffset++, 1));
              Severity: Major
              Found in thumbs/phpthumb.bmp.php and 1 other location - About 2 hrs to fix
              thumbs/phpthumb.bmp.php on lines 611..620

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

              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

                      echo "
                      <tr valign='middle'>
                          <td class='$class'>
                              $name
                              <br>
              Severity: Major
              Found in admin/myblocksadmin.php and 1 other location - About 2 hrs to fix
              admin/myblocksadmin2.php on lines 225..272

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

              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