XoopsModules25x/apcal

View on GitHub

Showing 26,336 of 26,336 total issues

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

        showHideElements: function (tagName, visibility) {
            var els = document.getElementsByTagName(tagName);
            var prop = tagName == '*' ? 'overflow' : 'visibility';
            for (var i = 0; i < els.length; i++) {
                if (prop == 'visibility' || (document.defaultView.getComputedStyle(
Severity: Minor
Found in assets/images/js/highslide/highslide-with-gallery.js - About 6 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 _shiftBoundaries has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring.
Open

    public function _shiftBoundaries($lines, &$changed, $other_changed)
    {
        $i = 0;
        $j = 0;

Severity: Minor
Found in include/Text_Diff.php - About 6 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_calendar_information has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring.
Open

        public function get_calendar_information($mode = 'M')
        {
            $ret = array();

            // ���ܾ���
Severity: Minor
Found in class/APCal.php - About 6 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 ResolveFilenameToAbsolute has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring.
Open

    public function ResolveFilenameToAbsolute($filename)
    {
        if (empty($filename)) {
            return false;
        }
Severity: Minor
Found in thumbs/phpthumb.class.php - About 6 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

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

            if (this.iframe) {
                try {
                    var exp = this,
                        doc = this.iframe.contentDocument || this.iframe.contentWindow.document;
                    hs.addEventListener(doc, 'mousedown', function () {
Severity: Major
Found in assets/images/js/highslide/highslide-full.js and 1 other location - About 6 hrs to fix
assets/images/js/highslide/highslide-with-html.js on lines 1805..1816

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

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.iframe) {
                try {
                    var exp = this,
                        doc = this.iframe.contentDocument || this.iframe.contentWindow.document;
                    hs.addEventListener(doc, 'mousedown', function () {
Severity: Major
Found in assets/images/js/highslide/highslide-with-html.js and 1 other location - About 6 hrs to fix
assets/images/js/highslide/highslide-full.js on lines 2309..2320

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

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

PatTemplate has 46 functions (exceeds 20 allowed). Consider refactoring.
Open

    class PatTemplate
    {
        /**
         * Constructor
         *
Severity: Minor
Found in include/patTemplate.php - About 6 hrs to fix

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

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

      Function DropShadow has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring.
      Open

          public function DropShadow(&$gdimg, $distance, $width, $hexcolor, $angle, $alpha)
          {
              if (phpthumb_functions::gd_version() < 2) {
                  return false;
              }
      Severity: Minor
      Found in thumbs/phpthumb.filters.php - About 6 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

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

      <?php
      
      if( defined( 'FOR_XOOPS_LANG_CHECKER' ) || ! defined( 'APCAL_BL_LOADED' ) ) {
      
      define( 'APCAL_BL_LOADED' , 1 ) ;
      Severity: Major
      Found in language/french/blocks.php and 1 other location - About 6 hrs to fix
      language/utf8_tw/blocks.php on lines 1..31

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

      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

      <?php
      
      if( defined( 'FOR_XOOPS_LANG_CHECKER' ) || ! defined( 'APCAL_BL_LOADED' ) ) {
      
      define( 'APCAL_BL_LOADED' , 1 ) ;
      Severity: Major
      Found in language/utf8_tw/blocks.php and 1 other location - About 6 hrs to fix
      language/french/blocks.php on lines 1..33

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

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

          public function CleanUpCacheDirectory()
          {
              $this->DebugMessage('CleanUpCacheDirectory() set to purge ('
                                  . (is_null($this->config_cache_maxage) ? 'NULL' : number_format($this->config_cache_maxage / 86400, 1))
                                  . ' days; '
      Severity: Major
      Found in thumbs/phpthumb.class.php - About 6 hrs to fix

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

                fitOverlayBox: function (ratio, changed) {
                    var x = this.x, y = this.y;
                    if (this.overlayBox) {
                        while (y.size > this.minHeight && x.size > this.minWidth
                        && y.get('wsize') > y.get('fitsize')) {
        Severity: Major
        Found in assets/images/js/highslide/highslide.js and 1 other location - About 6 hrs to fix
        assets/images/js/highslide/highslide-with-gallery.js on lines 1513..1525

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

        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

                fitOverlayBox: function (ratio, changed) {
                    var x = this.x, y = this.y;
                    if (this.overlayBox) {
                        while (y.size > this.minHeight && x.size > this.minWidth
                        && y.get('wsize') > y.get('fitsize')) {
        Severity: Major
        Found in assets/images/js/highslide/highslide-with-gallery.js and 1 other location - About 6 hrs to fix
        assets/images/js/highslide/highslide.js on lines 1277..1289

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

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

        function xoops_module_update_apcal(XoopsModule $module)
        {
            //    global $xoopsDB;
            $moduleDirName = basename(dirname(__DIR__));
            $capsDirName   = strtoupper($moduleDirName);
        Severity: Major
        Found in include/onupdate.php - About 6 hrs to fix

          hs has 44 functions (exceeds 20 allowed). Consider refactoring.
          Open

              var hs = {
          // Language strings
                  lang: {
                      cssDirection: 'ltr',
                      loadingText: 'Loading...',
          Severity: Minor
          Found in assets/images/js/highslide/highslide-with-html.js - About 6 hrs to fix

            phpthumb_functions has 44 functions (exceeds 20 allowed). Consider refactoring.
            Open

            class phpthumb_functions
            {
            
                /**
                 * @param $functionname
            Severity: Minor
            Found in thumbs/phpthumb.functions.php - About 6 hrs to fix

              Method ExtractEXIFgetImageSize has 149 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function ExtractEXIFgetImageSize()
                  {
                      $this->DebugMessage('starting ExtractEXIFgetImageSize()', __FILE__, __LINE__);
              
                      if (preg_match('#^http:#i', $this->src) && !$this->sourceFilename && $this->rawImageData) {
              Severity: Major
              Found in thumbs/phpthumb.class.php - About 5 hrs to fix

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

                        if (!this.outlineType) {
                            this[this.contentType + 'Create']();
                
                        } else if (hs.pendingOutlines[this.outlineType]) {
                            this.connectOutline();
                Severity: Major
                Found in assets/images/js/highslide/highslide-with-html.js and 1 other location - About 5 hrs to fix
                assets/images/js/highslide/highslide.js on lines 1055..1071

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

                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.outlineType) {
                            this[this.contentType + 'Create']();
                
                        } else if (hs.pendingOutlines[this.outlineType]) {
                            this.connectOutline();
                Severity: Major
                Found in assets/images/js/highslide/highslide.js and 1 other location - About 5 hrs to fix
                assets/images/js/highslide/highslide-with-html.js on lines 1236..1252

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

                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