XoopsModules25x/apcal

View on GitHub

Showing 26,336 of 26,336 total issues

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-with-gallery.js - About 2 days to fix

    File phpthumb.functions.php has 985 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.functions.php - About 2 days to fix

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

              sizeOverlayBox: function (doWrapper, doPanels) {
                  var overlayBox = this.overlayBox,
                      x = this.x,
                      y = this.y;
                  hs.setStyles(overlayBox, {
      Severity: Major
      Found in assets/images/js/highslide/highslide-with-html.js and 3 other locations - About 2 days to fix
      assets/images/js/highslide/highslide-full.js on lines 2854..2886
      assets/images/js/highslide/highslide-with-gallery.js on lines 2269..2301
      assets/images/js/highslide/highslide.js on lines 1752..1784

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

      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

              sizeOverlayBox: function (doWrapper, doPanels) {
                  var overlayBox = this.overlayBox,
                      x = this.x,
                      y = this.y;
                  hs.setStyles(overlayBox, {
      Severity: Major
      Found in assets/images/js/highslide/highslide-full.js and 3 other locations - About 2 days to fix
      assets/images/js/highslide/highslide-with-gallery.js on lines 2269..2301
      assets/images/js/highslide/highslide-with-html.js on lines 2263..2295
      assets/images/js/highslide/highslide.js on lines 1752..1784

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

      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

              sizeOverlayBox: function (doWrapper, doPanels) {
                  var overlayBox = this.overlayBox,
                      x = this.x,
                      y = this.y;
                  hs.setStyles(overlayBox, {
      Severity: Major
      Found in assets/images/js/highslide/highslide-with-gallery.js and 3 other locations - About 2 days to fix
      assets/images/js/highslide/highslide-full.js on lines 2854..2886
      assets/images/js/highslide/highslide-with-html.js on lines 2263..2295
      assets/images/js/highslide/highslide.js on lines 1752..1784

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

      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

              sizeOverlayBox: function (doWrapper, doPanels) {
                  var overlayBox = this.overlayBox,
                      x = this.x,
                      y = this.y;
                  hs.setStyles(overlayBox, {
      Severity: Major
      Found in assets/images/js/highslide/highslide.js and 3 other locations - About 2 days to fix
      assets/images/js/highslide/highslide-full.js on lines 2854..2886
      assets/images/js/highslide/highslide-with-gallery.js on lines 2269..2301
      assets/images/js/highslide/highslide-with-html.js on lines 2263..2295

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

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

          public function parse($filename, $calendar_name)
          {
              $ifile = @fopen($filename, 'r');
              if ($ifile === false) {
                  return "-1: File cannot open. filename: $filename";
      Severity: Minor
      Found in class/iCal_parser.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

      Function update_schedule has a Cognitive Complexity of 115 (exceeds 5 allowed). Consider refactoring.
      Open

              public function update_schedule($set_sql_append = '', $whr_sql_append = '', $notify_callback = null)
              {
                  if ($_POST['summary'] === '') {
                      $_POST['summary'] = _APCAL_MB_NOSUBJECT;
                  }
      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

      File iCal_parser.php has 939 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      <?php
      /*
       * You may not change or alter any portion of this comment or credits
       * of supporting developers from this source code or any supporting source code
       * which is considered copyrighted (c) material of the original comment or credit authors.
      Severity: Major
      Found in class/iCal_parser.php - About 2 days to fix

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

                calcExpanded: function () {
                    var exp = this.exp;
                    this.justify = 'auto';
        
        
        
        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 936..958

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

        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';
        
        
        
        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 1102..1124

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

        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 (ss && this.last && ss.controls && ss.fixedControls) {
                                var pos = ss.overlayOptions.position || '', p;
                                for (var dim in hs.oPos) for (var i = 0; i < 5; i++) {
                                    p = this[dim];
                                    if (pos.match(hs.oPos[dim][i])) {
        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 1655..1670

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

        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 (ss && this.last && ss.controls && ss.fixedControls) {
                                var pos = ss.overlayOptions.position || '', p;
                                for (var dim in hs.oPos) for (var i = 0; i < 5; i++) {
                                    p = this[dim];
                                    if (pos.match(hs.oPos[dim][i])) {
        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 1375..1390

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

        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_schedule_view_html has 442 lines of code (exceeds 25 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: Major
        Found in class/APCal.php - About 2 days to fix

          File xoops_version.php has 896 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          <?php
          /*
           * You may not change or alter any portion of this comment or credits
           * of supporting developers from this source code or any supporting source code
           * which is considered copyrighted (c) material of the original comment or credit authors.
          Severity: Major
          Found in xoops_version.php - About 2 days to fix

            Method getid3_bmp has 435 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function getid3_bmp(&$BMPdata, &$ThisFileInfo, $ExtractPalette = false, $ExtractData = false)
                {
            
                    // shortcuts
                    $ThisFileInfo['bmp']['header']['raw'] = array();
            Severity: Major
            Found in thumbs/phpthumb.bmp.php - About 2 days to fix

              Function CleanUpCacheDirectory has a Cognitive Complexity of 107 (exceeds 5 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: 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

              File APCal_xoops.php has 883 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              <?php
              /*
               * You may not change or alter any portion of this comment or credits
               * of supporting developers from this source code or any supporting source code
               * which is considered copyrighted (c) material of the original comment or credit authors.
              Severity: Major
              Found in class/APCal_xoops.php - About 2 days to fix

                Function get_schedule_edit_html has a Cognitive Complexity of 106 (exceeds 5 allowed). Consider refactoring.
                Open

                        public function get_schedule_edit_html()
                        {
                            $editable  = $this->editable;
                            $superedit = $this->superedit;
                            $deletable = $this->deletable;
                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

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

                        initSlideshow: function () {
                            if (!this.last) {
                                for (var i = 0; i < hs.slideshows.length; i++) {
                                    var ss = hs.slideshows[i], sg = ss.slideshowGroup;
                                    if (typeof sg == 'undefined' || sg === null || sg === this.slideshowGroup)
                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 1879..1909

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

                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