XoopsModules25x/apcal

View on GitHub

Showing 26,336 of 26,336 total issues

Function print has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

Date.prototype.print = function (str) {
    var m = this.getMonth();
    var d = this.getDate();
    var y = this.getFullYear();
    var wn = this.getWeekNumber();
Severity: Minor
Found in assets/js/jscalendar/calendar.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 18 (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-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 dragHandler has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

        dragHandler: function (e) {
            if (!hs.dragArgs) return true;
            if (!e) e = window.event;
            var a = hs.dragArgs, exp = a.exp;

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

        step: function (gotoEnd) {
            var t = (new Date()).getTime();
            if (gotoEnd || t >= this.options.duration + this.startTime) {
                this.now = this.end;
                this.pos = this.state = 1;
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 wrapperMouseHandler has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

        wrapperMouseHandler: function (e) {
            try {
                if (!e) e = window.event;
                var over = /mouseover/i.test(e.type);
                if (!e.target) e.target = e.srcElement; // ie
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 step has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

        step: function (gotoEnd) {
            var t = (new Date()).getTime();
            if (gotoEnd || t >= this.options.duration + this.startTime) {
                this.now = this.end;
                this.pos = this.state = 1;
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 step has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

        step: function (gotoEnd) {
            var t = (new Date()).getTime();
            if (gotoEnd || t >= this.options.duration + this.startTime) {
                this.now = this.end;
                this.pos = this.state = 1;
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 wrapperMouseHandler has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

        wrapperMouseHandler: function (e) {
            try {
                if (!e) e = window.event;
                var over = /mouseover/i.test(e.type);
                if (!e.target) e.target = e.srcElement; // ie
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 wrapperMouseHandler has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

        wrapperMouseHandler: function (e) {
            try {
                if (!e) e = window.event;
                var over = /mouseover/i.test(e.type);
                if (!e.target) e.target = e.srcElement; // ie
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 dragHandler has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

        dragHandler: function (e) {
            if (!hs.dragArgs) return true;
            if (!e) e = window.event;
            var a = hs.dragArgs, exp = a.exp;

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

        public function getVars($template)
        {
            $vars = array();
            //  parse all vars
            if (is_array($this->variables[$template])) {
Severity: Minor
Found in include/patTemplate.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 gif_outputAsJpeg has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

function gif_outputAsJpeg($gif, $lpszFileName, $bgColor = -1)
{
    // JPEG output that does not require cjpeg added by James Heinrich <info@silisoftware.com> - December 10, 2003
    if ((strtoupper(substr(PHP_OS, 0, 3)) != 'WIN') && (file_exists('/usr/local/bin/cjpeg') || `which cjpeg`)) {
        if (gif_outputAsBmp($gif, $lpszFileName . '.bmp', $bgColor)) {
Severity: Minor
Found in thumbs/phpthumb.gif.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 ImageMagickSwitchAvailable has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

    public function ImageMagickSwitchAvailable($switchname)
    {
        static $IMoptions = null;
        if (is_null($IMoptions)) {
            $IMoptions   = array();
Severity: Minor
Found in thumbs/phpthumb.class.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 EnsureDirectoryExists has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

    public static function EnsureDirectoryExists($dirname)
    {
        $directory_elements = explode(DIRECTORY_SEPARATOR, $dirname);
        $startoffset        = (!$directory_elements[0] ? 2 : 1);  // unix with leading "/" then start with 2nd element; Windows with leading "c:\" then start with 1st element
        $open_basedirs      = preg_split('#[;:]#', ini_get('open_basedir'));
Severity: Minor
Found in thumbs/phpthumb.functions.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 contentLoaded has 60 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        contentLoaded: function () {
            try {
                if (!this.content) return;
                this.content.onload = null;
                if (this.onLoadStarted) return;
Severity: Major
Found in assets/images/js/highslide/highslide-with-gallery.js - About 2 hrs to fix

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

            setPos: function (i) {
                this.pos = i;
                this.exp.wrapper.style[this.lt] = i + 'px';
    
                if (this.exp.outline) this.exp.outline.setPosition();
    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 1352..1358
    assets/images/js/highslide/highslide-with-html.js on lines 1153..1159
    assets/images/js/highslide/highslide.js on lines 973..979

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

    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

            setPos: function (i) {
                this.pos = i;
                this.exp.wrapper.style[this.lt] = i + 'px';
    
                if (this.exp.outline) this.exp.outline.setPosition();
    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 1158..1164
    assets/images/js/highslide/highslide-with-html.js on lines 1153..1159
    assets/images/js/highslide/highslide.js on lines 973..979

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

    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 4 locations. Consider refactoring.
    Open

                        if (this.isImage && this.x.full > (this.x.imgSize || this.x.size)) {
                            this.createFullExpand();
                            if (this.overlays.length == 1) this.sizeOverlayBox();
                        }
    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 1671..1674
    assets/images/js/highslide/highslide-with-gallery.js on lines 1391..1394
    assets/images/js/highslide/highslide-with-html.js on lines 1433..1436

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

    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 4 locations. Consider refactoring.
    Open

                        if (this.isImage && this.x.full > (this.x.imgSize || this.x.size)) {
                            this.createFullExpand();
                            if (this.overlays.length == 1) this.sizeOverlayBox();
                        }
    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 1671..1674
    assets/images/js/highslide/highslide-with-html.js on lines 1433..1436
    assets/images/js/highslide/highslide.js on lines 1175..1178

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

    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

            setPos: function (i) {
                this.pos = i;
                this.exp.wrapper.style[this.lt] = i + 'px';
    
                if (this.exp.outline) this.exp.outline.setPosition();
    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 1352..1358
    assets/images/js/highslide/highslide-with-gallery.js on lines 1158..1164
    assets/images/js/highslide/highslide.js on lines 973..979

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

    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