XoopsModules25x/apcal

View on GitHub

Showing 26,336 of 26,336 total issues

Function loadHTML has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
Open

        loadHTML: function () {
            var s = this.cachedGet || this.xhr.responseText,
                regBody;
            if (this.pre) hs.cachedGets[this.src] = s;
            if (!hs.ie || hs.uaVersion >= 5.5) {
Severity: Minor
Found in assets/images/js/highslide/highslide-full.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

Function showHideElements has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
Open

        showHideElements: function (tagName, visibility) {
            var els = document.getElementsByTagName(tagName);
            var prop = tagName == '*' ? 'overflow' : 'visibility';
            for (var i = 0; i < els.length; i++) {
                if (prop == 'visibility' || (document.defaultView.getComputedStyle(
Severity: Minor
Found in assets/images/js/highslide/highslide-with-html.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

Function showHideElements has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
Open

        showHideElements: function (tagName, visibility) {
            var els = document.getElementsByTagName(tagName);
            var prop = tagName == '*' ? 'overflow' : 'visibility';
            for (var i = 0; i < els.length; i++) {
                if (prop == 'visibility' || (document.defaultView.getComputedStyle(
Severity: Minor
Found in assets/images/js/highslide/highslide.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

Function loadHTML has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
Open

        loadHTML: function () {
            var s = this.cachedGet || this.xhr.responseText,
                regBody;
            if (this.pre) hs.cachedGets[this.src] = s;
            if (!hs.ie || hs.uaVersion >= 5.5) {
Severity: Minor
Found in assets/images/js/highslide/highslide-with-html.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

Function AlphaChannelFlatten has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
Open

    public function AlphaChannelFlatten()
    {
        if (!$this->is_alpha) {
            // image doesn't have alpha transparency, no need to flatten
            $this->DebugMessage('skipping AlphaChannelFlatten() because !$this->is_alpha', __FILE__, __LINE__);
Severity: Minor
Found in thumbs/phpthumb.class.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 2 locations. Consider refactoring.
Open

        addSlideshow: function (options) {
            var sg = options.slideshowGroup;
            if (typeof sg == 'object') {
                for (var i = 0; i < sg.length; i++) {
                    var o = {};
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 515..527

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

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

        addSlideshow: function (options) {
            var sg = options.slideshowGroup;
            if (typeof sg == 'object') {
                for (var i = 0; i < sg.length; i++) {
                    var o = {};
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 659..671

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

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

            for (var i = 0; i < hs.overlays.length; i++) {
                var o = hs.overlays[i], tId = o.thumbnailId, sg = o.slideshowGroup;
                if ((!tId && !sg) || (tId && tId == this.thumbsUserSetId)
                    || (sg && sg === this.slideshowGroup)) {
                    if (this.isImage || (this.isHtml && o.useOnHtml))
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 2820..2827

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

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

            for (var i = 0; i < hs.overlays.length; i++) {
                var o = hs.overlays[i], tId = o.thumbnailId, sg = o.slideshowGroup;
                if ((!tId && !sg) || (tId && tId == this.thumbsUserSetId)
                    || (sg && sg === this.slideshowGroup)) {
                    if (this.isImage || (this.isHtml && o.useOnHtml))
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 2229..2236

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

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

Calendar.setup = function (params) {
    function param_default(pname, def) {
        if (typeof params[pname] == "undefined") {
            params[pname] = def;
        }
Severity: Major
Found in assets/js/jscalendar/calendar-setup.js - About 5 hrs to fix

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

        hs.addEventListener(window, 'resize', function () {
            hs.getPageSize();
            if (hs.viewport) for (var i = 0; i < hs.viewport.childNodes.length; i++) {
                var node = hs.viewport.childNodes[i],
                    exp = hs.getExpander(node);
    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 2681..2689

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

    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

        hs.addEventListener(window, 'resize', function () {
            hs.getPageSize();
            if (hs.viewport) for (var i = 0; i < hs.viewport.childNodes.length; i++) {
                var node = hs.viewport.childNodes[i],
                    exp = hs.getExpander(node);
    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 3387..3395

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

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

        public function _diag($xoff, $xlim, $yoff, $ylim, $nchunks)
        {
            $flip = false;
    
            if ($xlim - $xoff > $ylim - $yoff) {
    Severity: Minor
    Found in include/Text_Diff.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 get_xoops_search_result has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
    Open

            public function get_xoops_search_result($keywords, $andor, $limit, $offset, $uid)
            {
                // �����׻�
                $tzoffset = ($this->user_TZ - $this->server_TZ) * 3600;
    
    
    Severity: Minor
    Found in class/APCal_xoops.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

    Method output_ics has 134 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            public function output_ics()
            {
                // $event_id �����ꤵ��Ƥ��ʤ���н�λ
                if (empty($_GET['event_id']) && empty($_POST['event_ids'])) {
                    die(_APCAL_ERR_INVALID_EVENT_ID);
    Severity: Major
    Found in class/APCal.php - About 5 hrs to fix

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

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

        Function get_flags_date_has_events has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
        Open

                public function get_flags_date_has_events($range_start_s, $range_end_s, $mode = '')
                {
                    // ���餫����������������Ƥ���
                    /* for ($time = $start ; $time < $end ; $time += 86400) {
                $ret[ date( 'j' , $time ) ] = 0 ;
        Severity: Minor
        Found in class/APCal.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 getBmp has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
        Open

            public function getBmp($bgColor)
            {
                $out = '';
        
                if (!$this->m_bLoaded) {
        Severity: Minor
        Found in thumbs/phpthumb.gif.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 2 locations. Consider refactoring.
        Open

                    if (this.isImage) {
                        this.content.title = hs.lang.restoreTitle;
        
                        if (hs.restoreCursor) {
                            hs.styleRestoreCursor = window.opera ? 'pointer' : 'url(' + hs.graphicsDir + hs.restoreCursor + '), pointer';
        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 1991..1999

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

        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) {
                        this.content.title = hs.lang.restoreTitle;
        
                        if (hs.restoreCursor) {
                            hs.styleRestoreCursor = window.opera ? 'pointer' : 'url(' + hs.graphicsDir + hs.restoreCursor + '), pointer';
        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 2553..2561

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

        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