XoopsModules25x/apcal

View on GitHub

Showing 26,336 of 26,336 total issues

Function import_ics_via_fopen has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

        public function import_ics_via_fopen($uri, $force_http = true, $user_uri = '')
        {
            $user_uri = empty($user_uri) ? '' : $uri;
            // changing webcal://* to http://*
            $uri = str_replace('webcal://', 'http://', $uri);
Severity: Minor
Found in class/APCal_xoops.php - 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_where_about_class has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

        public function get_where_about_class()
        {
            if ($this->isadmin) {
                // �����Ԥ�����Ԥʤ���True
                return '1';
Severity: Minor
Found in class/APCal.php - 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 load has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public function load($data, &$datLen)
    {
        $datLen = 0;

        while (true) {
Severity: Minor
Found in thumbs/phpthumb.gif.php - 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 RenderToFile has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public function RenderToFile($filename)
    {
        if (preg_match('#^[a-z0-9]+://#i', $filename)) {
            $this->DebugMessage('RenderToFile() failed because $filename (' . $filename . ') is a URL', __FILE__, __LINE__);

Severity: Minor
Found in thumbs/phpthumb.class.php - 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 FixedAspectRatio has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public function FixedAspectRatio()
    {
        // optional fixed-dimension images (regardless of aspect ratio)

        if (!$this->far) {
Severity: Minor
Found in thumbs/phpthumb.class.php - 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

Method ImageResizeFunction has 10 arguments (exceeds 4 allowed). Consider refactoring.
Open

    public function ImageResizeFunction(&$dst_im, &$src_im, $dstX, $dstY, $srcX, $srcY, $dstW, $dstH, $srcW, $srcH)
Severity: Major
Found in thumbs/phpthumb.class.php - About 1 hr to fix

    Function Brightness has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

        public function Brightness(&$gdimg, $amount = 0)
        {
            if ($amount == 0) {
                return true;
            }
    Severity: Minor
    Found in thumbs/phpthumb.filters.php - 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

    Method ImageCopyResampleBicubic has 10 arguments (exceeds 4 allowed). Consider refactoring.
    Open

            $dst_img,
            $src_img,
            $dst_x,
            $dst_y,
            $src_x,
    Severity: Major
    Found in thumbs/phpthumb.functions.php - About 1 hr to fix

      Function SafeExec has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

          public static function SafeExec($command)
          {
              static $AllowedExecFunctions = array();
              if (empty($AllowedExecFunctions)) {
                  $AllowedExecFunctions = array('shell_exec' => true, 'passthru' => true, 'system' => true, 'exec' => true);
      Severity: Minor
      Found in thumbs/phpthumb.functions.php - 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

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

                  if (this.transitions[1] == 'crossfade' && hs.upcoming) {
                      hs.getExpander(hs.upcoming).cancelLoading();
                      hs.upcoming = null;
                  }
      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-gallery.js on lines 2079..2082

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

      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 (up) {
                      this.wrapper.style.visibility = 'visible';
                      this.content.style.visibility = 'visible';
                      this.a.className += ' highslide-active-anchor';
                  }
      Severity: Major
      Found in assets/images/js/highslide/highslide-with-gallery.js and 1 other location - About 1 hr to fix
      assets/images/js/highslide/highslide.js on lines 1366..1370

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

      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

                      hs.viewport = hs.createElement('div', {
                              className: 'highslide-viewport highslide-viewport-size'
                          }, {
                              visibility: (hs.safari && hs.uaVersion < 525) ? 'visible' : 'hidden'
                          }, hs.container, 1
      Severity: Major
      Found in assets/images/js/highslide/highslide-with-gallery.js and 1 other location - About 1 hr to fix
      assets/images/js/highslide/highslide-full.js on lines 951..956

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

      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

                      hs.viewport = hs.createElement('div', {
                              className: 'highslide-viewport highslide-viewport-size'
                          }, {
                              visibility: (hs.safari && hs.uaVersion < 525) ? 'visible' : 'hidden'
                          }, hs.container, 1
      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-gallery.js on lines 775..780

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

      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 (up) {
                      this.wrapper.style.visibility = 'visible';
                      this.content.style.visibility = 'visible';
                      this.a.className += ' highslide-active-anchor';
                  }
      Severity: Major
      Found in assets/images/js/highslide/highslide.js and 1 other location - About 1 hr to fix
      assets/images/js/highslide/highslide-with-gallery.js on lines 1614..1618

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

      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.transitions[1] == 'crossfade' && hs.upcoming) {
                      hs.getExpander(hs.upcoming).cancelLoading();
                      hs.upcoming = null;
                  }
      Severity: Major
      Found in assets/images/js/highslide/highslide-with-gallery.js and 1 other location - About 1 hr to fix
      assets/images/js/highslide/highslide-full.js on lines 2589..2592

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

      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 Outline has 31 lines of code (exceeds 25 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

        Function justify has 31 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                justify: function (p, moveOnly) {
                    var tgtArr, tgt = p.target, dim = p == this.x ? 'x' : 'y';
        
                    var hasMovedMin = false;
        
        
        Severity: Minor
        Found in assets/images/js/highslide/highslide.js - About 1 hr to fix

          Function close has 31 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  close: function () {
                      if (this.isClosing || !this.isExpanded) return;
                      if (this.transitions[1] == 'crossfade' && hs.upcoming) {
                          hs.getExpander(hs.upcoming).cancelLoading();
                          hs.upcoming = null;
          Severity: Minor
          Found in assets/images/js/highslide/highslide-full.js - About 1 hr to fix

            Function sizeOverlayBox has 31 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    sizeOverlayBox: function (doWrapper, doPanels) {
                        var overlayBox = this.overlayBox,
                            x = this.x,
                            y = this.y;
                        hs.setStyles(overlayBox, {
            Severity: Minor
            Found in assets/images/js/highslide/highslide-with-gallery.js - About 1 hr to fix

              Function sizeOverlayBox has 31 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      sizeOverlayBox: function (doWrapper, doPanels) {
                          var overlayBox = this.overlayBox,
                              x = this.x,
                              y = this.y;
                          hs.setStyles(overlayBox, {
              Severity: Minor
              Found in assets/images/js/highslide/highslide.js - About 1 hr to fix
                Severity
                Category
                Status
                Source
                Language