XoopsModules25x/apcal

View on GitHub

Showing 26,336 of 26,336 total issues

Function OutputThumbnail has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
Open

    public function OutputThumbnail()
    {
        $this->purgeTempFiles();

        if (!$this->useRawIMoutput && !is_resource($this->gdimg_output)) {
Severity: Minor
Found in thumbs/phpthumb.class.php - About 4 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

Method get_mini_calendar_html has 105 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        public function get_mini_calendar_html($get_target = '', $query_string = '', $mode = '')
        {
            // �¹Ի��ַ�¬��������
            // list( $usec , $sec ) = explode( " " , microtime() ) ;
            // $apcalstarttime = $sec + $usec ;
Severity: Major
Found in class/APCal.php - About 4 hrs to fix

    Function _init has 104 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    Calendar.prototype._init = function (firstDayOfWeek, date) {
        var today = new Date(),
            TY = today.getFullYear(),
            TM = today.getMonth(),
            TD = today.getDate();
    Severity: Major
    Found in assets/js/jscalendar/calendar.js - About 4 hrs to fix

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

              getCacheBinding: function (a) {
                  for (var i = 0; i < hs.cacheBindings.length; i++) {
                      if (hs.cacheBindings[i][0] == a) {
                          var c = hs.cacheBindings[i][1];
                          hs.cacheBindings[i][1] = c.cloneNode(1);
      Severity: Major
      Found in assets/images/js/highslide/highslide-full.js and 1 other location - About 4 hrs to fix
      assets/images/js/highslide/highslide-with-html.js on lines 332..341

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

      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

              getCacheBinding: function (a) {
                  for (var i = 0; i < hs.cacheBindings.length; i++) {
                      if (hs.cacheBindings[i][0] == a) {
                          var c = hs.cacheBindings[i][1];
                          hs.cacheBindings[i][1] = c.cloneNode(1);
      Severity: Major
      Found in assets/images/js/highslide/highslide-with-html.js and 1 other location - About 4 hrs to fix
      assets/images/js/highslide/highslide-full.js on lines 420..429

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

      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

              for (var i = 0; i < hs.expanders.length; i++) {
                  if (hs.expanders[i] && hs.expanders[i].a == a
                      && !(this.last && this.transitions[1] == 'crossfade')) {
                      hs.expanders[i].focus();
                      return false;
      Severity: Major
      Found in assets/images/js/highslide/highslide-with-gallery.js and 1 other location - About 4 hrs to fix
      assets/images/js/highslide/highslide-full.js on lines 1395..1401

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

      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

              for (var i = 0; i < hs.expanders.length; i++) {
                  if (hs.expanders[i] && hs.expanders[i].a == a
                      && !(this.last && this.transitions[1] == 'crossfade')) {
                      hs.expanders[i].focus();
                      return false;
      Severity: Major
      Found in assets/images/js/highslide/highslide-full.js and 1 other location - About 4 hrs to fix
      assets/images/js/highslide/highslide-with-gallery.js on lines 1199..1205

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

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

              htmlCreate: function () {
                  if (!hs.fireEvent(this, 'onBeforeGetContent')) return;
      
                  this.content = hs.getCacheBinding(this.a);
                  if (!this.content)
      Severity: Minor
      Found in assets/images/js/highslide/highslide-full.js - About 4 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 hideShowCovered has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
      Open

      Calendar.prototype.hideShowCovered = function () {
          if (!Calendar.is_ie && !Calendar.is_opera)
              return;
          function getVisib(obj) {
              var value = obj.style.visibility;
      Severity: Minor
      Found in assets/js/jscalendar/calendar.js - About 4 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 createOverlay has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
      Open

              createOverlay: function (o) {
                  var el = o.overlayId,
                      relToVP = (o.relativeTo == 'viewport' && !/panel$/.test(o.position));
                  if (typeof el == 'string') el = hs.getNode(el);
                  if (o.html) el = hs.createElement('div', {innerHTML: o.html});
      Severity: Minor
      Found in assets/images/js/highslide/highslide-with-gallery.js - About 4 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 contentLoaded has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
      Open

              contentLoaded: function () {
                  try {
                      if (!this.content) return;
                      this.content.onload = null;
                      if (this.onLoadStarted) return;
      Severity: Minor
      Found in assets/images/js/highslide/highslide-with-html.js - About 4 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 WatermarkOverlay has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
      Open

          public function WatermarkOverlay(
              &$gdimg_dest,
              &$img_watermark,
              $alignment = '*',
              $opacity = 50,
      Severity: Minor
      Found in thumbs/phpthumb.filters.php - About 4 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

      Method SetCacheFilename has 102 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function SetCacheFilename()
          {
              if (!is_null($this->cache_filename)) {
                  $this->DebugMessage('$this->cache_filename already set, skipping SetCacheFilename()', __FILE__, __LINE__);
      
      
      Severity: Major
      Found in thumbs/phpthumb.class.php - About 4 hrs to fix

        Method ResolveFilenameToAbsolute has 102 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function ResolveFilenameToAbsolute($filename)
            {
                if (empty($filename)) {
                    return false;
                }
        Severity: Major
        Found in thumbs/phpthumb.class.php - About 4 hrs to fix

          Method apcal_minical_ex_show has 100 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              function apcal_minical_ex_show($options)
              {
                  global $xoopsConfig, $xoopsDB, $xoopsUser;
          
                  // speed check
          Severity: Major
          Found in blocks/apcal_minical_ex.php - About 4 hrs to fix

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

                    if (!hs.allowMultipleInstances && !hs.upcoming) {
                        if (hs.expanders[key - 1]) hs.expanders[key - 1].close();
                        if (typeof hs.focusKey != 'undefined' && hs.expanders[hs.focusKey])
                            hs.expanders[hs.focusKey].close();
                    }
            Severity: Major
            Found in assets/images/js/highslide/highslide.js and 3 other locations - About 4 hrs to fix
            assets/images/js/highslide/highslide-full.js on lines 1410..1414
            assets/images/js/highslide/highslide-with-gallery.js on lines 1214..1218
            assets/images/js/highslide/highslide-with-html.js on lines 1207..1211

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

            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 4 locations. Consider refactoring.
            Open

                    if (!hs.allowMultipleInstances && !hs.upcoming) {
                        if (hs.expanders[key - 1]) hs.expanders[key - 1].close();
                        if (typeof hs.focusKey != 'undefined' && hs.expanders[hs.focusKey])
                            hs.expanders[hs.focusKey].close();
                    }
            Severity: Major
            Found in assets/images/js/highslide/highslide-with-html.js and 3 other locations - About 4 hrs to fix
            assets/images/js/highslide/highslide-full.js on lines 1410..1414
            assets/images/js/highslide/highslide-with-gallery.js on lines 1214..1218
            assets/images/js/highslide/highslide.js on lines 1026..1030

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

            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 4 locations. Consider refactoring.
            Open

                    getExpander: function (el, expOnly) {
                        if (typeof el == 'undefined') return hs.expanders[hs.focusKey] || null;
                        if (typeof el == 'number') return hs.expanders[el] || null;
                        if (typeof el == 'string') el = hs.$(el);
                        return hs.expanders[hs.getWrapperKey(el, expOnly)] || null;
            Severity: Major
            Found in assets/images/js/highslide/highslide-with-gallery.js and 3 other locations - About 4 hrs to fix
            assets/images/js/highslide/highslide-full.js on lines 698..703
            assets/images/js/highslide/highslide-with-html.js on lines 529..534
            assets/images/js/highslide/highslide.js on lines 390..395

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

            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 4 locations. Consider refactoring.
            Open

                    getExpander: function (el, expOnly) {
                        if (typeof el == 'undefined') return hs.expanders[hs.focusKey] || null;
                        if (typeof el == 'number') return hs.expanders[el] || null;
                        if (typeof el == 'string') el = hs.$(el);
                        return hs.expanders[hs.getWrapperKey(el, expOnly)] || null;
            Severity: Major
            Found in assets/images/js/highslide/highslide-with-html.js and 3 other locations - About 4 hrs to fix
            assets/images/js/highslide/highslide-full.js on lines 698..703
            assets/images/js/highslide/highslide-with-gallery.js on lines 554..559
            assets/images/js/highslide/highslide.js on lines 390..395

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

            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 4 locations. Consider refactoring.
            Open

                    if (!hs.allowMultipleInstances && !hs.upcoming) {
                        if (hs.expanders[key - 1]) hs.expanders[key - 1].close();
                        if (typeof hs.focusKey != 'undefined' && hs.expanders[hs.focusKey])
                            hs.expanders[hs.focusKey].close();
                    }
            Severity: Major
            Found in assets/images/js/highslide/highslide-with-gallery.js and 3 other locations - About 4 hrs to fix
            assets/images/js/highslide/highslide-full.js on lines 1410..1414
            assets/images/js/highslide/highslide-with-html.js on lines 1207..1211
            assets/images/js/highslide/highslide.js on lines 1026..1030

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

            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