XoopsModules25x/apcal

View on GitHub

Showing 26,336 of 26,336 total issues

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

        justify: function (p, moveOnly) {
            var tgtArr, tgt = p.target, dim = p == this.x ? 'x' : 'y';

            var hasMovedMin = false;

Severity: Major
Found in assets/images/js/highslide/highslide-with-html.js and 1 other location - About 3 days to fix
assets/images/js/highslide/highslide.js on lines 1187..1226

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

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 phpthumb.filters.php has 1327 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
//////////////////////////////////////////////////////////////
//   phpThumb() by James Heinrich <info@silisoftware.com>   //
//        available at http://phpthumb.sourceforge.net      //
//         and/or https://github.com/JamesHeinrich/phpThumb //
Severity: Major
Found in thumbs/phpthumb.filters.php - About 3 days to fix

    Method ImageMagickThumbnailToGD has 669 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function ImageMagickThumbnailToGD()
        {
            // http://www.imagemagick.org/script/command-line-options.php
    
            $this->useRawIMoutput = true;
    Severity: Major
    Found in thumbs/phpthumb.class.php - About 3 days to fix

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

              correctRatio: function (ratio) {
                  var x = this.x,
                      y = this.y,
                      changed = false,
                      xSize = Math.min(x.full, x.size),
      Severity: Major
      Found in assets/images/js/highslide/highslide-with-html.js and 3 other locations - About 3 days to fix
      assets/images/js/highslide/highslide-full.js on lines 1923..1971
      assets/images/js/highslide/highslide-with-gallery.js on lines 1464..1512
      assets/images/js/highslide/highslide.js on lines 1228..1276

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

      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

              correctRatio: function (ratio) {
                  var x = this.x,
                      y = this.y,
                      changed = false,
                      xSize = Math.min(x.full, x.size),
      Severity: Major
      Found in assets/images/js/highslide/highslide.js and 3 other locations - About 3 days to fix
      assets/images/js/highslide/highslide-full.js on lines 1923..1971
      assets/images/js/highslide/highslide-with-gallery.js on lines 1464..1512
      assets/images/js/highslide/highslide-with-html.js on lines 1640..1688

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

      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

              correctRatio: function (ratio) {
                  var x = this.x,
                      y = this.y,
                      changed = false,
                      xSize = Math.min(x.full, x.size),
      Severity: Major
      Found in assets/images/js/highslide/highslide-full.js and 3 other locations - About 3 days to fix
      assets/images/js/highslide/highslide-with-gallery.js on lines 1464..1512
      assets/images/js/highslide/highslide-with-html.js on lines 1640..1688
      assets/images/js/highslide/highslide.js on lines 1228..1276

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

      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

              correctRatio: function (ratio) {
                  var x = this.x,
                      y = this.y,
                      changed = false,
                      xSize = Math.min(x.full, x.size),
      Severity: Major
      Found in assets/images/js/highslide/highslide-with-gallery.js and 3 other locations - About 3 days to fix
      assets/images/js/highslide/highslide-full.js on lines 1923..1971
      assets/images/js/highslide/highslide-with-html.js on lines 1640..1688
      assets/images/js/highslide/highslide.js on lines 1228..1276

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

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

              public function get_weekly_html($get_target = '')
              {
                  $roimage = XOOPS_URL . '/modules/apcal/assets/images/regonline/regonline.png'; // added by goffy: image for online registration
                  $ret     = "
           <table border='0' cellspacing='0' cellpadding='0' width='100%' style='border-collapse:collapse;margin:0px;'>
      Severity: Minor
      Found in class/APCal.php - About 3 days 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

              calcExpanded: function () {
                  var exp = this.exp;
                  this.justify = 'auto';
      
                  // get alignment
      Severity: Major
      Found in assets/images/js/highslide/highslide-full.js and 1 other location - About 3 days to fix
      assets/images/js/highslide/highslide-with-gallery.js on lines 1111..1139

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

      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

              calcExpanded: function () {
                  var exp = this.exp;
                  this.justify = 'auto';
      
                  // get alignment
      Severity: Major
      Found in assets/images/js/highslide/highslide-with-gallery.js and 1 other location - About 3 days to fix
      assets/images/js/highslide/highslide-full.js on lines 1291..1319

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

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

              public function get_schedule_view_html($for_print = false)
              {
                  global $xoopsTpl;
      
                  $smode     = empty($_GET['smode']) ? 'Monthly' : preg_replace('/[^a-zA-Z0-9_-]/', '', $_GET['smode']);
      Severity: Minor
      Found in class/APCal.php - About 2 days 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 get_schedule_edit_html has 581 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              public function get_schedule_edit_html()
              {
                  $editable  = $this->editable;
                  $superedit = $this->superedit;
                  $deletable = $this->deletable;
      Severity: Major
      Found in class/APCal.php - About 2 days to fix

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

                fade: function (up, to) {
                    this.outlineWhileAnimating = false;
                    var exp = this, t = up ? hs.expandDuration : 0;
        
                    if (up) {
        Severity: Major
        Found in assets/images/js/highslide/highslide-full.js and 1 other location - About 2 days to fix
        assets/images/js/highslide/highslide-with-gallery.js on lines 1622..1668

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

        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

                fade: function (up, to) {
                    this.outlineWhileAnimating = false;
                    var exp = this, t = up ? hs.expandDuration : 0;
        
                    if (up) {
        Severity: Major
        Found in assets/images/js/highslide/highslide-with-gallery.js and 1 other location - About 2 days to fix
        assets/images/js/highslide/highslide-full.js on lines 2105..2151

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

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

            public function SourceImageToGD()
            {
                if (is_resource($this->gdimg_source)) {
                    $this->source_width  = imagesx($this->gdimg_source);
                    $this->source_height = imagesy($this->gdimg_source);
        Severity: Minor
        Found in thumbs/phpthumb.class.php - About 2 days 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

                createOverlay: function (o) {
                    var el = o.overlayId;
                    if (typeof el == 'string') el = hs.getNode(el);
                    if (o.html) el = hs.createElement('div', {innerHTML: o.html});
                    if (!el || typeof el == 'string') return;
        Severity: Major
        Found in assets/images/js/highslide/highslide.js and 1 other location - About 2 days to fix
        assets/images/js/highslide/highslide-with-html.js on lines 2120..2159

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

        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

                createOverlay: function (o) {
                    var el = o.overlayId;
                    if (typeof el == 'string') el = hs.getNode(el);
                    if (o.html) el = hs.createElement('div', {innerHTML: o.html});
                    if (!el || typeof el == 'string') return;
        Severity: Major
        Found in assets/images/js/highslide/highslide-with-html.js and 1 other location - About 2 days to fix
        assets/images/js/highslide/highslide.js on lines 1610..1649

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

        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

        Consider simplifying this complex logical expression.
        Open

        if (!hs) {
            var hs = {
        // Language strings
                lang: {
                    cssDirection: 'ltr',
        Severity: Critical
        Found in assets/images/js/highslide/highslide-full.js - About 2 days to fix

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

                  focus: function () {
                      this.wrapper.style.zIndex = hs.zIndexCounter += 2;
                      // blur others
                      for (var i = 0; i < hs.expanders.length; i++) {
                          if (hs.expanders[i] && i == hs.focusKey) {
          Severity: Major
          Found in assets/images/js/highslide/highslide.js and 1 other location - About 2 days to fix
          assets/images/js/highslide/highslide-with-gallery.js on lines 2029..2055

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

          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

                  focus: function () {
                      this.wrapper.style.zIndex = hs.zIndexCounter += 2;
                      // blur others
                      for (var i = 0; i < hs.expanders.length; i++) {
                          if (hs.expanders[i] && i == hs.focusKey) {
          Severity: Major
          Found in assets/images/js/highslide/highslide-with-gallery.js and 1 other location - About 2 days to fix
          assets/images/js/highslide/highslide.js on lines 1533..1559

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

          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