XoopsModules25x/apcal

View on GitHub

Showing 26,336 of 26,336 total issues

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

        calcBorders: function () {
            // correct for borders
            this.cb = (this.exp.content['offset' + this.ucwh] - this.t) / 2;

            this.marginMax = hs['margin' + this.ucrb];
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 1275..1280
assets/images/js/highslide/highslide-with-gallery.js on lines 1095..1100
assets/images/js/highslide/highslide-with-html.js on lines 1086..1091

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

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 (tgt) {
                l = tgt.x.get('loadingPosXfade') + 'px';
                t = tgt.y.get('loadingPosXfade') + 'px';
                this.loading.style.zIndex = hs.zIndexCounter++;
            }
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-gallery.js on lines 1290..1294

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

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

        public function get_blockarray_new_event($get_target = '', $num = 5)
        {
            // if( $get_target == '' ) $get_target = $_SERVER['SCRIPT_NAME'] ;

            // tzoffset
Severity: Major
Found in class/APCal_xoops.php - About 2 hrs to fix

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

            resizeTo: function (w, h) {
                this.y.setSize(h);
                this.x.setSize(w);
                this.wrapper.style.height = this.y.get('wsize') + 'px';
            },
    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 2581..2585
    assets/images/js/highslide/highslide-with-gallery.js on lines 2071..2075
    assets/images/js/highslide/highslide-with-html.js on lines 2018..2022

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

    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

            resizeTo: function (w, h) {
                this.y.setSize(h);
                this.x.setSize(w);
                this.wrapper.style.height = this.y.get('wsize') + 'px';
            },
    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 2071..2075
    assets/images/js/highslide/highslide-with-html.js on lines 2018..2022
    assets/images/js/highslide/highslide.js on lines 1575..1579

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

    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

            resizeTo: function (w, h) {
                this.y.setSize(h);
                this.x.setSize(w);
                this.wrapper.style.height = this.y.get('wsize') + 'px';
            },
    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 2581..2585
    assets/images/js/highslide/highslide-with-gallery.js on lines 2071..2075
    assets/images/js/highslide/highslide.js on lines 1575..1579

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

    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

            resizeTo: function (w, h) {
                this.y.setSize(h);
                this.x.setSize(w);
                this.wrapper.style.height = this.y.get('wsize') + 'px';
            },
    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 2581..2585
    assets/images/js/highslide/highslide-with-html.js on lines 2018..2022
    assets/images/js/highslide/highslide.js on lines 1575..1579

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

    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.dim == 'y' && exp.iDoc && exp.body.style.height != 'auto') try {
                    exp.iDoc.body.style.overflow = 'auto';
                } catch (e) {
                }
    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 1138..1141

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

    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.dim == 'y' && exp.iDoc && exp.body.style.height != 'auto') try {
                    exp.iDoc.body.style.overflow = 'auto';
                } catch (e) {
                }
    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 1333..1336

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

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

            close: function () {
                if (this.isClosing || !this.isExpanded) return;
                if (this.transitions[1] == 'crossfade' && hs.upcoming) {
                    hs.getExpander(hs.upcoming).cancelLoading();
                    hs.upcoming = null;
    Severity: Minor
    Found in assets/images/js/highslide/highslide-full.js - 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

    Function custom has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
    Open

            custom: function (from, to, unit) {
                this.startTime = (new Date()).getTime();
                this.start = from;
                this.end = to;
                this.unit = unit;// || this.unit || "px";
    Severity: Minor
    Found in assets/images/js/highslide/highslide-full.js - 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

    Function afterExpand has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
    Open

            afterExpand: function () {
                this.isExpanded = true;
                this.focus();
    
                if (this.isHtml && this.objectLoadTime == 'after') this.writeExtendedContent();
    Severity: Minor
    Found in assets/images/js/highslide/highslide-with-html.js - 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

    Function custom has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
    Open

            custom: function (from, to, unit) {
                this.startTime = (new Date()).getTime();
                this.start = from;
                this.end = to;
                this.unit = unit;// || this.unit || "px";
    Severity: Minor
    Found in assets/images/js/highslide/highslide-with-html.js - 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

    Function custom has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
    Open

            custom: function (from, to, unit) {
                this.startTime = (new Date()).getTime();
                this.start = from;
                this.end = to;
                this.unit = unit;// || this.unit || "px";
    Severity: Minor
    Found in assets/images/js/highslide/highslide-with-gallery.js - 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

    Function custom has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
    Open

            custom: function (from, to, unit) {
                this.startTime = (new Date()).getTime();
                this.start = from;
                this.end = to;
                this.unit = unit;// || this.unit || "px";
    Severity: Minor
    Found in assets/images/js/highslide/highslide.js - 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

    Function rebuild_cat_tree has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
    Open

    function rebuild_cat_tree($cat_table)
    {
        global $conn, $xoopsDB;
    
        $rs      = $GLOBALS['xoopsDB']->query("SELECT cid,pid FROM $cat_table ORDER BY pid ASC,weight DESC");
    Severity: Minor
    Found in admin/categories.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

    Function get_date_schedule has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
    Open

            public function get_date_schedule($get_target = '')
            {
                // if( $get_target == '' ) $get_target = $_SERVER['SCRIPT_NAME'] ;
    
                $ret = '';
    Severity: Minor
    Found in class/APCal.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

    Function get_blockarray_new_event has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
    Open

            public function get_blockarray_new_event($get_target = '', $num = 5)
            {
                // if( $get_target == '' ) $get_target = $_SERVER['SCRIPT_NAME'] ;
    
                // tzoffset
    Severity: Minor
    Found in class/APCal_xoops.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

    Function HistogramOverlay has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
    Open

        public function HistogramOverlay(
            &$gdimg,
            $bands = '*',
            $colors = '',
            $width = 0.25,
    Severity: Minor
    Found in thumbs/phpthumb.filters.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

    Method get_monthly has 52 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            public function get_monthly($get_target = '', $query_string = '', $for_print = false)
            {
                // $PHP_SELF = $_SERVER['SCRIPT_NAME'] ;
                // if( $get_target == '' ) $get_target = $PHP_SELF ;
    
    
    Severity: Major
    Found in class/APCal.php - About 2 hrs to fix
      Severity
      Category
      Status
      Source
      Language