XoopsModules25x/apcal

View on GitHub

Showing 26,336 of 26,336 total issues

Function CalculateThumbnailDimensions has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

    public function CalculateThumbnailDimensions()
    {
        $this->DebugMessage('CalculateThumbnailDimensions() starting with [W,H,sx,sy,sw,sh] initially set to ['
                            . $this->source_width
                            . ','
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 ResolveSource has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

    public function ResolveSource()
    {
        if (is_resource($this->gdimg_source)) {
            $this->DebugMessage('ResolveSource() exiting because is_resource($this->gdimg_source)', __FILE__, __LINE__);

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

    public function ImageBorder(&$gdimg, $border_width, $radius_x, $radius_y, $hexcolor_border)
    {
        $border_width = ($border_width ?: 1);
        $radius_x     = ($radius_x ?: 0);
        $radius_y     = ($radius_y ?: 0);
Severity: Minor
Found in thumbs/phpthumb.filters.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 Colorize has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

    public function Colorize(&$gdimg, $amount, $targetColor)
    {
        $amount      = (is_numeric($amount) ? $amount : 25);
        $amountPct   = $amount / 100;
        $targetColor = (phpthumb_functions::IsHexColor($targetColor) ? $targetColor : 'gray');
Severity: Minor
Found in thumbs/phpthumb.filters.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 positionOverlay has 56 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        positionOverlay: function (overlay) {
            var p = overlay.position || 'middle center',
                offX = overlay.offsetX,
                offY = overlay.offsetY;
            if (overlay.parentNode != this.overlayBox) this.overlayBox.appendChild(overlay);
Severity: Major
Found in assets/images/js/highslide/highslide.js - About 2 hrs to fix

    Method check has 56 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            public function check($post = true, $area = '')
            {
                global $xoopsModule;
    
                $this->_errors = array();
    Severity: Major
    Found in include/gtickets.php - About 2 hrs to fix

      Function positionOverlay has 56 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              positionOverlay: function (overlay) {
                  var p = overlay.position || 'middle center',
                      offX = overlay.offsetX,
                      offY = overlay.offsetY;
                  if (overlay.parentNode != this.overlayBox) this.overlayBox.appendChild(overlay);
      Severity: Major
      Found in assets/images/js/highslide/highslide-with-html.js - About 2 hrs to fix

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

                                if ($event->allday) {
                                    if ($event->start + $tzoffset >= $now_unixtime + 86400
                                        || $event->end + $tzoffset <= $now_unixtime
                                    ) {
                                        continue;
        Severity: Major
        Found in class/APCal.php and 1 other location - About 2 hrs to fix
        class/APCal.php on lines 1850..1866

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

        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 ($event->allday) {
                                if ($event->start + $tzoffset >= $now_unixtime + 86400
                                    || $event->end + $tzoffset <= $now_unixtime
                                ) {
                                    continue;
        Severity: Major
        Found in class/APCal.php and 1 other location - About 2 hrs to fix
        class/APCal.php on lines 1913..1928

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

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

                public function get_flags_date_has_events($range_start_s, $range_end_s, $mode = '')
                {
                    // ���餫����������������Ƥ���
                    /* for ($time = $start ; $time < $end ; $time += 86400) {
                $ret[ date( 'j' , $time ) ] = 0 ;
        Severity: Major
        Found in class/APCal.php - About 2 hrs to fix

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

                      var exp = this,
                          last = this.last,
                          x = this.x,
                          y = this.y,
                          lastX = last.x,
          Severity: Major
          Found in assets/images/js/highslide/highslide-with-gallery.js and 1 other location - About 2 hrs to fix
          assets/images/js/highslide/highslide-full.js on lines 2154..2162

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

          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

          Calendar._TT["ABOUT"] =
              "DHTML Date/Time Selector\n" +
              "(c) dynarch.com 2002-2005 / Author: Mihai Bazon\n" +
              "Poslednú verziu nájdete na: http://www.dynarch.com/projects/calendar/\n" +
              "Distribuované pod GNU LGPL.  Viď http://gnu.org/licenses/lgpl.html pre detaily." +
          Severity: Major
          Found in assets/js/jscalendar/lang/calendar-sk.js and 1 other location - About 2 hrs to fix
          assets/js/jscalendar/lang/calendar-nl.js on lines 32..41

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

          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

                      var exp = this,
                          last = this.last,
                          x = this.x,
                          y = this.y,
                          lastX = last.x,
          Severity: Major
          Found in assets/images/js/highslide/highslide-full.js and 1 other location - About 2 hrs to fix
          assets/images/js/highslide/highslide-with-gallery.js on lines 1671..1679

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

          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

          Calendar._TT["ABOUT"] =
              "DHTML Datum/Tijd Selector\n" +
              "(c) dynarch.com 2002-2005 / Author: Mihai Bazon\n" +
              "Ga voor de meest recente versie naar: http://www.dynarch.com/projects/calendar/\n" +
              "Verspreid onder de GNU LGPL. Zie http://gnu.org/licenses/lgpl.html voor details." +
          Severity: Major
          Found in assets/js/jscalendar/lang/calendar-nl.js and 1 other location - About 2 hrs to fix
          assets/js/jscalendar/lang/calendar-sk.js on lines 65..74

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

          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 print has 54 lines of code (exceeds 25 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: Major
          Found in assets/js/jscalendar/calendar.js - About 2 hrs to fix

            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/images/js/highslide/highslide-with-gallery.js - About 2 hrs to fix

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

              Similar blocks of code found in 4 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/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 1095..1100
              assets/images/js/highslide/highslide-with-html.js on lines 1086..1091
              assets/images/js/highslide/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 4 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/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 1275..1280
              assets/images/js/highslide/highslide-with-html.js on lines 1086..1091
              assets/images/js/highslide/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

              Severity
              Category
              Status
              Source
              Language