XoopsModules25x/apcal

View on GitHub

Showing 26,336 of 26,336 total issues

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

        getAdjacentAnchor: function (op) {
            var current = this.getAnchorIndex(), as = hs.anchors.groups[this.slideshowGroup || 'none'];
            if (as && !as[current + op] && this.slideshow && this.slideshow.repeat) {
                if (op == 1) return as[0];
                else if (op == -1) return as[as.length - 1];
Severity: Major
Found in assets/images/js/highslide/highslide-full.js and 1 other location - About 5 hrs to fix
assets/images/js/highslide/highslide-with-gallery.js on lines 1851..1858

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

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

        getAdjacentAnchor: function (op) {
            var current = this.getAnchorIndex(), as = hs.anchors.groups[this.slideshowGroup || 'none'];
            if (as && !as[current + op] && this.slideshow && this.slideshow.repeat) {
                if (op == 1) return as[0];
                else if (op == -1) return as[as.length - 1];
Severity: Major
Found in assets/images/js/highslide/highslide-with-gallery.js and 1 other location - About 5 hrs to fix
assets/images/js/highslide/highslide-full.js on lines 2353..2360

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

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

        public function check($post = true, $area = '')
        {
            global $xoopsModule;

            $this->_errors = array();
Severity: Minor
Found in include/gtickets.php - About 5 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 ImprovedImageRotate has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring.
Open

    public static function ImprovedImageRotate(
        &$gdimg_source,
        $rotate_angle = 0,
        $config_background_hexcolor = 'FFFFFF',
        $bg = null,
Severity: Minor
Found in thumbs/phpthumb.filters.php - About 5 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

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

        replaceLang: function (s) {
            s = s.replace(/\s/g, ' ');
            var re = /{hs\.lang\.([^}]+)\}/g,
                matches = s.match(re),
                lang;
Severity: Major
Found in assets/images/js/highslide/highslide-with-gallery.js and 2 other locations - About 5 hrs to fix
assets/images/js/highslide/highslide-full.js on lines 379..389
assets/images/js/highslide/highslide-with-html.js on lines 319..329

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

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

        replaceLang: function (s) {
            s = s.replace(/\s/g, ' ');
            var re = /{hs\.lang\.([^}]+)\}/g,
                matches = s.match(re),
                lang;
Severity: Major
Found in assets/images/js/highslide/highslide-full.js and 2 other locations - About 5 hrs to fix
assets/images/js/highslide/highslide-with-gallery.js on lines 302..312
assets/images/js/highslide/highslide-with-html.js on lines 319..329

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

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

        getNumber: function () {
            if (this[this.numberPosition]) {
                var arr = hs.anchors.groups[this.slideshowGroup || 'none'];
                if (arr) {
                    var s = hs.lang.number.replace('%1', this.getAnchorIndex() + 1).replace('%2', arr.length);
Severity: Major
Found in assets/images/js/highslide/highslide-with-gallery.js and 1 other location - About 5 hrs to fix
assets/images/js/highslide/highslide-full.js on lines 2371..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 150.

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

        getNumber: function () {
            if (this[this.numberPosition]) {
                var arr = hs.anchors.groups[this.slideshowGroup || 'none'];
                if (arr) {
                    var s = hs.lang.number.replace('%1', this.getAnchorIndex() + 1).replace('%2', arr.length);
Severity: Major
Found in assets/images/js/highslide/highslide-full.js and 1 other location - About 5 hrs to fix
assets/images/js/highslide/highslide-with-gallery.js on lines 1869..1878

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

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

        replaceLang: function (s) {
            s = s.replace(/\s/g, ' ');
            var re = /{hs\.lang\.([^}]+)\}/g,
                matches = s.match(re),
                lang;
Severity: Major
Found in assets/images/js/highslide/highslide-with-html.js and 2 other locations - About 5 hrs to fix
assets/images/js/highslide/highslide-full.js on lines 379..389
assets/images/js/highslide/highslide-with-gallery.js on lines 302..312

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

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

        public function get_daily_html($get_target = '')
        {
            $roimage = XOOPS_URL . '/modules/apcal/assets/images/regonline/regonline.png'; // added by goffy: image for online registration
            // get the result of plugins
            $plugin_returns = array();
Severity: Major
Found in class/APCal.php - About 5 hrs to fix

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

            getPosition: function (el) {
                var p = {x: el.offsetLeft, y: el.offsetTop};
                while (el.offsetParent) {
                    el = el.offsetParent;
                    p.x += el.offsetLeft;
    Severity: Major
    Found in assets/images/js/highslide/highslide-with-gallery.js and 2 other locations - About 5 hrs to fix
    assets/images/js/highslide/highslide-with-html.js on lines 265..277
    assets/images/js/highslide/highslide.js on lines 204..216

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

    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

            getPosition: function (el) {
                var p = {x: el.offsetLeft, y: el.offsetTop};
                while (el.offsetParent) {
                    el = el.offsetParent;
                    p.x += el.offsetLeft;
    Severity: Major
    Found in assets/images/js/highslide/highslide.js and 2 other locations - About 5 hrs to fix
    assets/images/js/highslide/highslide-with-gallery.js on lines 269..281
    assets/images/js/highslide/highslide-with-html.js on lines 265..277

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

    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.isImage) {
                        x.full = this.content.width;
                        y.full = this.content.height;
    
                        hs.setStyles(this.content, {
    Severity: Major
    Found in assets/images/js/highslide/highslide-full.js and 1 other location - About 5 hrs to fix
    assets/images/js/highslide/highslide-with-html.js on lines 1398..1408

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

    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.isImage) {
                        x.full = this.content.width;
                        y.full = this.content.height;
    
                        hs.setStyles(this.content, {
    Severity: Major
    Found in assets/images/js/highslide/highslide-with-html.js and 1 other location - About 5 hrs to fix
    assets/images/js/highslide/highslide-full.js on lines 1616..1626

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

    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

            getPosition: function (el) {
                var p = {x: el.offsetLeft, y: el.offsetTop};
                while (el.offsetParent) {
                    el = el.offsetParent;
                    p.x += el.offsetLeft;
    Severity: Major
    Found in assets/images/js/highslide/highslide-with-html.js and 2 other locations - About 5 hrs to fix
    assets/images/js/highslide/highslide-with-gallery.js on lines 269..281
    assets/images/js/highslide/highslide.js on lines 204..216

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

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

            public function dump()
            {
                echo "<style type=\"text/css\">\n";
                echo ".text      {font-family: Verdana, Arial, sans-serif; font-size: 10px; color: #000000}\n";
                echo ".mid       {font-family: Verdana, Arial, sans-serif; font-size: 12px; color: #000000}\n";
    Severity: Major
    Found in include/patTemplate.php - About 5 hrs to fix

      hs has 42 functions (exceeds 20 allowed). Consider refactoring.
      Open

          var hs = {
      // Language strings
              lang: {
                  cssDirection: 'ltr',
                  loadingText: 'Loading...',
      Severity: Minor
      Found in assets/images/js/highslide/highslide-with-gallery.js - About 5 hrs to fix

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

        if (!empty($target_module) && is_object($target_module)) {
            // specified by dirname
            $target_mid     = $target_module->getVar('mid');
            $target_mname   = $target_module->getVar('name') . '&nbsp;' . sprintf('(%2.2f)', $target_module->getVar('version') / 100.0);
            $query4redirect = '?dirname=' . urlencode(strip_tags($_GET['dirname']));
        Severity: Major
        Found in admin/myblocksadmin.php and 1 other location - About 5 hrs to fix
        admin/myblocksadmin2.php on lines 52..65

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

        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 (!empty($target_module) && is_object($target_module)) {
            // specified by dirname
            $target_mid     = $target_module->getVar('mid');
            $target_mname   = $target_module->getVar('name') . '&nbsp;' . sprintf('(%2.2f)', $target_module->getVar('version') / 100.0);
            $query4redirect = '?dirname=' . urlencode(strip_tags($_GET['dirname']));
        Severity: Major
        Found in admin/myblocksadmin2.php and 1 other location - About 5 hrs to fix
        admin/myblocksadmin.php on lines 68..81

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

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

        Calendar.setup = function (params) {
            function param_default(pname, def) {
                if (typeof params[pname] == "undefined") {
                    params[pname] = def;
                }
        Severity: Minor
        Found in assets/js/jscalendar/calendar-setup.js - About 5 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

        Severity
        Category
        Status
        Source
        Language