mambax7/extcal

View on GitHub

Showing 1,163 of 1,163 total issues

Function init has 54 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        init: function () {
            if (!hs.container) {

                hs.ieLt7 = hs.ie && hs.uaVersion < 7;
                hs.ieLt9 = hs.ie && hs.uaVersion < 9;
Severity: Major
Found in assets/js/highslide-with-gallery.js - About 2 hrs to fix

    Similar blocks of code found in 3 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/js/highslide-full.js and 2 other locations - About 2 hrs to fix
    assets/js/highslide-with-gallery.js on lines 1095..1100
    assets/js/highslide.js on lines 920..925

    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/js/highslide-full.js and 1 other location - About 2 hrs to fix
    assets/js/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

    Similar blocks of code found in 3 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/js/highslide-with-gallery.js and 2 other locations - About 2 hrs to fix
    assets/js/highslide-full.js on lines 1275..1280
    assets/js/highslide.js on lines 920..925

    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

    Similar blocks of code found in 3 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/js/highslide.js and 2 other locations - About 2 hrs to fix
    assets/js/highslide-full.js on lines 1275..1280
    assets/js/highslide-with-gallery.js on lines 1095..1100

    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/js/highslide-with-gallery.js and 1 other location - About 2 hrs to fix
    assets/js/highslide-full.js on lines 1490..1494

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

        public function objectToArray($objects, $externalKeys = [], $format = 's')
        {
            static $cache;
            if (!\is_array($externalKeys)) {
                $externalKeys = [$externalKeys];
    Severity: Major
    Found in class/ExtcalPersistableObjectHandler.php - About 2 hrs to fix

      Identical blocks of code found in 3 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/js/highslide-full.js and 2 other locations - About 2 hrs to fix
      assets/js/highslide-with-gallery.js on lines 2071..2075
      assets/js/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 3 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/js/highslide-with-gallery.js and 2 other locations - About 2 hrs to fix
      assets/js/highslide-full.js on lines 2581..2585
      assets/js/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 3 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/js/highslide.js and 2 other locations - About 2 hrs to fix
      assets/js/highslide-full.js on lines 2581..2585
      assets/js/highslide-with-gallery.js on lines 2071..2075

      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

      File Utility.php has 254 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      <?php
      
      namespace XoopsModules\Extcal;
      
      /**
      Severity: Minor
      Found in class/Utility.php - About 2 hrs to fix

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

                        for ($i = 0; $i < $n; ++$i) {
                            TrFctMessage(__FILE__, __LINE__, 3, 'Read complete 512 bytes block number ' . ($i + 1));
                            if ('tar' === $p_tar_mode) {
                                $v_content = fread($v_tar, 512);
                                fwrite($v_temp_tar, $v_content, 512);
        Severity: Major
        Found in class/pcltar.lib.php and 1 other location - About 2 hrs to fix
        class/pcltar.lib.php on lines 3173..3182

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

        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 ($j = 0; $j < $n; ++$j) {
                            TrFctMessage(__FILE__, __LINE__, 3, 'Read complete 512 bytes block number ' . ($j + 1));
                            if ('tar' === $p_tar_mode) {
                                $v_content = fread($v_tar, 512);
                                fwrite($v_temp_tar, $v_content, 512);
        Severity: Major
        Found in class/pcltar.lib.php and 1 other location - About 2 hrs to fix
        class/pcltar.lib.php on lines 2888..2897

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

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

            function updateBlock($bid, $btitle, $bside, $bweight, $bvisible, $bcachetime, $bmodule, $options, $groups)
            {
                $moduleDirName      = \basename(\dirname(__DIR__));
                $moduleDirNameUpper = \mb_strtoupper($moduleDirName);
        
        
        Severity: Minor
        Found in admin/blocksadmin.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 adjustDate has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
        Open

            public function adjustDate(&$y, &$m, &$d, &$h, &$i, &$s)
            {
                if ($s < 0) {
                    $m -= floor($s / _EXTCAL_TS_MINUTE);
                    $s = -$s % _EXTCAL_TS_MINUTE;
        Severity: Minor
        Found in class/pear/Calendar/Engine/PearDate.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 getEventsUniques has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
        Open

            public function getEventsUniques($criteres)
            {
                $cat = 0;
                //        while (list($k, $v) = each($criteres)) {
                foreach ($criteres as $k => $v) {
        Severity: Minor
        Found in class/EventHandler.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

        Severity
        Category
        Status
        Source
        Language