XoopsModules25x/apcal

View on GitHub

Showing 26,336 of 26,336 total issues

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

                if (phpthumb_functions::IsHexColor($bg_color)) {
                    $text_background_alpha = round(127 * ((100 - min(max(0, $bg_opacity), 100)) / 100));
                    $text_color_background = phpthumb_functions::ImageHexColorAllocate($img_watermark, $bg_color, false, $text_background_alpha);
                } else {
                    $text_color_background = phpthumb_functions::ImageHexColorAllocate($img_watermark, 'FFFFFF', false, 127);
Severity: Major
Found in thumbs/phpthumb.filters.php and 1 other location - About 1 hr to fix
thumbs/phpthumb.filters.php on lines 1552..1557

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

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 showHideElements has 40 lines of code (exceeds 25 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-full.js - About 1 hr to fix

    Function keyHandler has 40 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            keyHandler: function (e) {
                if (!e) e = window.event;
                if (!e.target) e.target = e.srcElement; // ie
                if (typeof e.target.form != 'undefined') return true; // form element has focus
                var exp = hs.getExpander();
    Severity: Minor
    Found in assets/images/js/highslide/highslide.js - About 1 hr to fix

      Function showHideElements has 40 lines of code (exceeds 25 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-gallery.js - About 1 hr to fix

        Function createOverlay has 40 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                createOverlay: function (o) {
                    var el = o.overlayId,
                        relToVP = (o.relativeTo == 'viewport' && !/panel$/.test(o.position));
                    if (typeof el == 'string') el = hs.getNode(el);
                    if (o.html) el = hs.createElement('div', {innerHTML: o.html});
        Severity: Minor
        Found in assets/images/js/highslide/highslide-with-gallery.js - About 1 hr to fix

          Function keyHandler has 40 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  keyHandler: function (e) {
                      if (!e) e = window.event;
                      if (!e.target) e.target = e.srcElement; // ie
                      if (typeof e.target.form != 'undefined') return true; // form element has focus
                      var exp = hs.getExpander();
          Severity: Minor
          Found in assets/images/js/highslide/highslide-with-html.js - About 1 hr to fix

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

                        if (this.outline && !this.outlineWhileAnimating) {
                            if (up) this.outline.setPosition();
                            else this.outline.destroy(
                                (this.isHtml && this.preserveContent));
                        }
            Severity: Major
            Found in assets/images/js/highslide/highslide-with-html.js and 1 other location - About 1 hr to fix
            assets/images/js/highslide/highslide-full.js on lines 2034..2038

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

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

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

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

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

            Refactorings

            Further Reading

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

                        if (this.outline && !this.outlineWhileAnimating) {
                            if (up) this.outline.setPosition();
                            else this.outline.destroy(
                                (this.isHtml && this.preserveContent));
                        }
            Severity: Major
            Found in assets/images/js/highslide/highslide-full.js and 1 other location - About 1 hr to fix
            assets/images/js/highslide/highslide-with-html.js on lines 1729..1733

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

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

                    getImageMapAreaCorrection: function (area) {
                        var c = area.coords.split(',');
                        for (var i = 0; i < c.length; i++) c[i] = parseInt(c[i]);
            
                        if (area.shape.toLowerCase() == 'circle') {
            Severity: Minor
            Found in assets/images/js/highslide/highslide-full.js - About 1 hr 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 has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
            Open

                    get: function (key) {
                        switch (key) {
                            case 'loadingPos':
                                return this.tpos + this.tb + (this.t - hs.loading['offset' + this.ucwh]) / 2;
                            case 'loadingPosXfade':
            Severity: Minor
            Found in assets/images/js/highslide/highslide-full.js - About 1 hr 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 css has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
            Open

                    css: function (el, prop) {
                        if (el.style[prop]) {
                            return el.style[prop];
                        } else if (document.defaultView) {
                            return document.defaultView.getComputedStyle(el, null).getPropertyValue(prop);
            Severity: Minor
            Found in assets/images/js/highslide/highslide-full.js - About 1 hr 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 Outline has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
            Open

                hs.Outline = function (outlineType, onLoad) {
                    this.onLoad = onLoad;
                    this.outlineType = outlineType;
                    var v = hs.uaVersion, tr;
            
            
            Severity: Minor
            Found in assets/images/js/highslide/highslide-full.js - About 1 hr 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 has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
            Open

                    get: function (key) {
                        switch (key) {
                            case 'loadingPos':
                                return this.tpos + this.tb + (this.t - hs.loading['offset' + this.ucwh]) / 2;
                            case 'wsize':
            Severity: Minor
            Found in assets/images/js/highslide/highslide.js - About 1 hr 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 Outline has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
            Open

                hs.Outline = function (outlineType, onLoad) {
                    this.onLoad = onLoad;
                    this.outlineType = outlineType;
                    var v = hs.uaVersion, tr;
            
            
            Severity: Minor
            Found in assets/images/js/highslide/highslide-with-html.js - About 1 hr 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 Outline has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
            Open

                hs.Outline = function (outlineType, onLoad) {
                    this.onLoad = onLoad;
                    this.outlineType = outlineType;
                    var v = hs.uaVersion, tr;
            
            
            Severity: Minor
            Found in assets/images/js/highslide/highslide.js - About 1 hr 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 css has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
            Open

                    css: function (el, prop) {
                        if (el.style[prop]) {
                            return el.style[prop];
                        } else if (document.defaultView) {
                            return document.defaultView.getComputedStyle(el, null).getPropertyValue(prop);
            Severity: Minor
            Found in assets/images/js/highslide/highslide-with-gallery.js - About 1 hr 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 Outline has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
            Open

                hs.Outline = function (outlineType, onLoad) {
                    this.onLoad = onLoad;
                    this.outlineType = outlineType;
                    var v = hs.uaVersion, tr;
            
            
            Severity: Minor
            Found in assets/images/js/highslide/highslide-with-gallery.js - About 1 hr 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 css has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
            Open

                    css: function (el, prop) {
                        if (el.style[prop]) {
                            return el.style[prop];
                        } else if (document.defaultView) {
                            return document.defaultView.getComputedStyle(el, null).getPropertyValue(prop);
            Severity: Minor
            Found in assets/images/js/highslide/highslide-with-html.js - About 1 hr 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 awake has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
            Open

                    awake: function () {
                        try {
            
                            hs.expanders[this.key] = this;
            
            
            Severity: Minor
            Found in assets/images/js/highslide/highslide-with-html.js - About 1 hr 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 has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
            Open

                    get: function (key) {
                        switch (key) {
                            case 'loadingPos':
                                return this.tpos + this.tb + (this.t - hs.loading['offset' + this.ucwh]) / 2;
                            case 'wsize':
            Severity: Minor
            Found in assets/images/js/highslide/highslide-with-html.js - About 1 hr 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