XoopsModules25x/apcal

View on GitHub

Showing 26,336 of 26,336 total issues

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

    hs.addEventListener(document, 'mousemove', function (e) {
        hs.mouse = {x: e.clientX, y: e.clientY};
    });
Severity: Major
Found in assets/images/js/highslide/highslide-with-html.js and 3 other locations - About 40 mins to fix
assets/images/js/highslide/highslide-full.js on lines 3396..3398
assets/images/js/highslide/highslide-with-gallery.js on lines 2690..2692
assets/images/js/highslide/highslide.js on lines 1913..1915

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

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.addEventListener(document, 'mousemove', function (e) {
        hs.mouse = {x: e.clientX, y: e.clientY};
    });
Severity: Major
Found in assets/images/js/highslide/highslide-full.js and 3 other locations - About 40 mins to fix
assets/images/js/highslide/highslide-with-gallery.js on lines 2690..2692
assets/images/js/highslide/highslide-with-html.js on lines 2541..2543
assets/images/js/highslide/highslide.js on lines 1913..1915

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

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.addEventListener(document, 'mousemove', function (e) {
        hs.mouse = {x: e.clientX, y: e.clientY};
    });
Severity: Major
Found in assets/images/js/highslide/highslide.js and 3 other locations - About 40 mins to fix
assets/images/js/highslide/highslide-full.js on lines 3396..3398
assets/images/js/highslide/highslide-with-gallery.js on lines 2690..2692
assets/images/js/highslide/highslide-with-html.js on lines 2541..2543

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

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

        getSelfRendered: function () {
            return hs.createElement('div', {
                className: 'highslide-html-content',
                innerHTML: hs.replaceLang(hs.skin.contentWrapper)
            });
Severity: Minor
Found in assets/images/js/highslide/highslide-full.js and 1 other location - About 40 mins to fix
assets/images/js/highslide/highslide-with-html.js on lines 304..309

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

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

            if (this.isHtml && this.preserveContent
                && this.transitions[1] != 'crossfade') {
                this.sleep();
            } else {
                if (this.outline && this.outlineWhileAnimating) this.outline.destroy();
Severity: Minor
Found in assets/images/js/highslide/highslide-full.js and 1 other location - About 40 mins to fix
assets/images/js/highslide/highslide-with-html.js on lines 2374..2380

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

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

        getSelfRendered: function () {
            return hs.createElement('div', {
                className: 'highslide-html-content',
                innerHTML: hs.replaceLang(hs.skin.contentWrapper)
            });
Severity: Minor
Found in assets/images/js/highslide/highslide-with-html.js and 1 other location - About 40 mins to fix
assets/images/js/highslide/highslide-full.js on lines 364..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 49.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

            if (this.isHtml && this.preserveContent) {
                this.sleep();
            } else {
                if (this.outline && this.outlineWhileAnimating) this.outline.destroy();

Severity: Minor
Found in assets/images/js/highslide/highslide-with-html.js and 1 other location - About 40 mins to fix
assets/images/js/highslide/highslide-full.js on lines 2979..2986

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

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

                                    if ($IMuseExplicitImageOutputDimensions) {
                                        if ($this->w && !$this->h) {
                                            $this->h = ceil($this->w / ($this->source_width / $this->source_height));
                                        } elseif ($this->h && !$this->w) {
                                            $this->w = ceil($this->h * ($this->source_width / $this->source_height));
Severity: Minor
Found in thumbs/phpthumb.class.php and 1 other location - About 40 mins to fix
thumbs/phpthumb.class.php on lines 2058..2064

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

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

                $otherHours = '<br>' . $d . '&nbsp;&nbsp;&nbsp;&nbsp;' . sprintf('%02d', $h[1]) . ':' . sprintf('%02d', $h[2]) . ' - ' . sprintf('%02d', $h[3]) . ':' . sprintf('%02d', $h[4]);
Severity: Minor
Found in class/APCal.php and 1 other location - About 40 mins to fix
class/APCal.php on lines 2482..2482

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

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

                                if ($IMuseExplicitImageOutputDimensions) {
                                    if ($this->w && !$this->h) {
                                        $this->h = ceil($this->w / ($this->source_width / $this->source_height));
                                    } elseif ($this->h && !$this->w) {
                                        $this->w = ceil($this->h * ($this->source_width / $this->source_height));
Severity: Minor
Found in thumbs/phpthumb.class.php and 1 other location - About 40 mins to fix
thumbs/phpthumb.class.php on lines 2079..2085

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

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

                    $otherHours .= '<br>' . $d . '&nbsp;&nbsp;&nbsp;&nbsp;' . sprintf('%02d', $h[1]) . ':' . sprintf('%02d', $h[2]) . ' - ' . sprintf('%02d', $h[3]) . ':' . sprintf('%02d', $h[4]);
Severity: Minor
Found in class/APCal.php and 1 other location - About 40 mins to fix
class/APCal.php on lines 2478..2478

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

Consider simplifying this complex logical expression.
Open

    if (ev.ctrlKey) {
        switch (K) {
            case 37: // KEY left
                act && Calendar.cellClick(cal._nav_pm);
                break;
Severity: Major
Found in assets/js/jscalendar/calendar.js - About 40 mins to fix

    Consider simplifying this complex logical expression.
    Open

                    if ((!tId && !sg) || (tId && tId == this.thumbsUserSetId)
                        || (sg && sg === this.slideshowGroup)) {
                        if (this.isImage || (this.isHtml && o.useOnHtml))
                            this.createOverlay(o);
                    }
    Severity: Major
    Found in assets/images/js/highslide/highslide-full.js - About 40 mins to fix

      Consider simplifying this complex logical expression.
      Open

                      if ((!tId && !sg) || (tId && tId == this.thumbsUserSetId)
                          || (sg && sg === this.slideshowGroup)) {
                          this.createOverlay(o);
                      }
      Severity: Major
      Found in assets/images/js/highslide/highslide-with-gallery.js - About 40 mins to fix

        Consider simplifying this complex logical expression.
        Open

                        if ((!tId && !sg) || (tId && tId == this.thumbsUserSetId)
                            || (sg && sg === this.slideshowGroup)) {
                            this.createOverlay(o);
                        }
        Severity: Major
        Found in assets/images/js/highslide/highslide.js - About 40 mins to fix

          Consider simplifying this complex logical expression.
          Open

                          if ((!tId && !sg) || (tId && tId == this.thumbsUserSetId)
                              || (sg && sg === this.slideshowGroup)) {
                              if (this.isImage || (this.isHtml && o.useOnHtml))
                                  this.createOverlay(o);
                          }
          Severity: Major
          Found in assets/images/js/highslide/highslide-with-html.js - About 40 mins to fix

            Consider simplifying this complex logical expression.
            Open

            if (!empty($_POST['fct']) && !empty($_POST['op']) && !empty($_POST['diranme']) && $_POST['fct'] === 'modulesadmin'
                && $_POST['op'] === 'update_ok'
                && $_POST['dirname'] == $modversion['dirname']
            ) {
                include __DIR__ . '/include/onupdate.inc.php';
            Severity: Major
            Found in xoops_version.php - About 40 mins to fix

              Classes should not have a constructor method with the same name as the class
              Open

                  public function phpThumb()
                  {
                      $this->DebugTimingMessage('phpThumb() constructor', __FILE__, __LINE__);
                      $this->DebugMessage('phpThumb() v' . $this->phpthumb_version, __FILE__, __LINE__);
              
              
              Severity: Minor
              Found in thumbs/phpthumb.class.php by phpmd

              ConstructorWithNameAsEnclosingClass

              Since: 0.2

              A constructor method should not have the same name as the enclosing class, consider to use the PHP 5 __construct method.

              Example

              class MyClass {
                   // this is bad because it is PHP 4 style
                  public function MyClass() {}
                  // this is good because it is a PHP 5 constructor
                  public function __construct() {}
              }

              Source https://phpmd.org/rules/naming.html#constructorwithnameasenclosingclass

              Each class must be in a file by itself
              Open

              class MyXoopsGroupFormCheckBox extends XoopsFormElement
              Severity: Minor
              Found in admin/mygrouppermform.php by phpcodesniffer

              Each class must be in a file by itself
              Open

              class Text_MappedDiff extends Text_Diff
              Severity: Minor
              Found in include/Text_Diff.php by phpcodesniffer
              Severity
              Category
              Status
              Source
              Language