XoopsModules25x/apcal

View on GitHub

Showing 26,336 of 26,336 total issues

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

while (list($title, $blog_id, $server_time) = $db->fetchRow($result)) {
    $user_time = $server_time + $tzoffset_s2u;
    //        if( date( 'n' , $user_time ) != $this->month ) continue ;
    $target_date = date('j', $user_time);
    $tmp_array   = array(
Severity: Major
Found in plugins/weekly/weblog-blogid.php and 1 other location - About 4 hrs to fix
plugins/daily/weblog-blogid.php on lines 74..95

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

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

Calendar.cellClick = function (el, ev) {
    var cal = el.calendar;
    var closing = false;
    var newdate = false;
    var date = null;
Severity: Major
Found in assets/js/jscalendar/calendar.js - About 4 hrs to fix

    Function Thumbstrip has 122 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        hs.Thumbstrip = function (slideshow) {
            function add(exp) {
                hs.extend(options || {}, {
                    overlayId: dom,
                    hsId: 'thumbstrip',
    Severity: Major
    Found in assets/images/js/highslide/highslide-with-gallery.js - About 4 hrs to fix

      Function Thumbstrip has 122 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          hs.Thumbstrip = function (slideshow) {
              function add(exp) {
                  hs.extend(options || {}, {
                      overlayId: dom,
                      hsId: 'thumbstrip',
      Severity: Major
      Found in assets/images/js/highslide/highslide-full.js - About 4 hrs to fix

        hs has 37 functions (exceeds 20 allowed). Consider refactoring.
        Open

            var hs = {
        // Language strings
                lang: {
                    cssDirection: 'ltr',
                    loadingText: 'Loading...',
        Severity: Minor
        Found in assets/images/js/highslide/highslide.js - About 4 hrs to fix

          phpthumb_filters has 37 functions (exceeds 20 allowed). Consider refactoring.
          Open

          class phpthumb_filters
          {
              public $phpThumbObject = null;
          
              // removed for XOOPS
          Severity: Minor
          Found in thumbs/phpthumb.filters.php - About 4 hrs to fix

            Function myblocksadmin_update_block has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
            Open

            function myblocksadmin_update_block(
                $bid,
                $bside,
                $bweight,
                $bvisible,
            Severity: Minor
            Found in include/blocksadmin.inc.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

            Function get_todays_time_description has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
            Open

                    public function get_todays_time_description(
                        $start,
                        $end,
                        $ynj,
                        $justify = true,
            Severity: Minor
            Found in class/APCal.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_blockarray_coming_event has 118 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    public function get_blockarray_coming_event($get_target = '', $num = 5, $for_coming = false, $untildays = 0)
                    {
                        // if( $get_target == '' ) $get_target = $_SERVER['SCRIPT_NAME'] ;
                        $now = $for_coming ? time() : $this->unixtime + $this->day_start;
            
            
            Severity: Major
            Found in class/APCal_xoops.php - About 4 hrs to fix

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

                      getNode: function (id) {
                          var node = hs.$(id), clone = hs.clones[id], a = {};
                          if (!node && !clone) return null;
                          if (!clone) {
                              clone = node.cloneNode(true);
              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 492..503
              assets/images/js/highslide/highslide-with-html.js on lines 404..415
              assets/images/js/highslide/highslide.js on lines 265..276

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

              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

                      getNode: function (id) {
                          var node = hs.$(id), clone = hs.clones[id], a = {};
                          if (!node && !clone) return null;
                          if (!clone) {
                              clone = node.cloneNode(true);
              Severity: Major
              Found in assets/images/js/highslide/highslide-full.js and 3 other locations - About 4 hrs to fix
              assets/images/js/highslide/highslide-with-gallery.js on lines 350..361
              assets/images/js/highslide/highslide-with-html.js on lines 404..415
              assets/images/js/highslide/highslide.js on lines 265..276

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

              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

                      getNode: function (id) {
                          var node = hs.$(id), clone = hs.clones[id], a = {};
                          if (!node && !clone) return null;
                          if (!clone) {
                              clone = node.cloneNode(true);
              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 492..503
              assets/images/js/highslide/highslide-with-gallery.js on lines 350..361
              assets/images/js/highslide/highslide-with-html.js on lines 404..415

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

              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

                      getNode: function (id) {
                          var node = hs.$(id), clone = hs.clones[id], a = {};
                          if (!node && !clone) return null;
                          if (!clone) {
                              clone = node.cloneNode(true);
              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 492..503
              assets/images/js/highslide/highslide-with-gallery.js on lines 350..361
              assets/images/js/highslide/highslide.js on lines 265..276

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

              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

                      writeCredits: function () {
                          if (this.credits) return;
                          this.credits = hs.createElement('a', {
                              href: hs.creditsHref,
                              target: hs.creditsTarget,
              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 2422..2436

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

              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

                      writeCredits: function () {
                          if (this.credits) return;
                          this.credits = hs.createElement('a', {
                              href: hs.creditsHref,
                              target: hs.creditsTarget,
              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 1919..1933

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

              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

                      preloadAjax: function (e) {
                          var arr = hs.getAnchors();
                          for (var i = 0; i < arr.htmls.length; i++) {
                              var a = arr.htmls[i];
                              if (hs.getParam(a, 'objectType') == 'ajax' && hs.getParam(a, 'cacheAjax'))
              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 431..440

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

              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

                      preloadAjax: function (e) {
                          var arr = hs.getAnchors();
                          for (var i = 0; i < arr.htmls.length; i++) {
                              var a = arr.htmls[i];
                              if (hs.getParam(a, 'objectType') == 'ajax' && hs.getParam(a, 'cacheAjax'))
              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 343..352

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

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

                      setSize: function (i) {
                          var exp = this.exp;
                          if (exp.isImage && (exp.useBox || hs.padToMinWidth)) {
                              this.imgSize = i;
                              this.size = Math.max(this.size, this.imgSize);
              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 createOverlay has a Cognitive Complexity of 31 (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-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 focus has a Cognitive Complexity of 31 (exceeds 5 allowed). 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: 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

              Severity
              Category
              Status
              Source
              Language