XoopsModules25x/smallworld

View on GitHub

Showing 1,838 of 1,838 total issues

Identical blocks of code found in 2 locations. 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 include/get_selects.php and 1 other location - About 6 hrs to fix
include/getSelects.php on lines 1..56

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

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

        _generateHTML: function (inst) {
            var today = new Date();
            today = this._daylightSavingAdjust(
                new Date(today.getFullYear(), today.getMonth(), today.getDate())); // clear time
            var isRTL = this._get(inst, 'isRTL');
Severity: Major
Found in assets/js/jquery-ui-1.8.11.custom.js - About 6 hrs to fix

    Function _generateHTML has 169 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        _generateHTML: function(inst) {
            var maxDraw, prevText, prev, nextText, next, currentText, gotoDate,
                controls, buttonPanel, firstDay, showWeek, dayNames, dayNamesMin,
                monthNames, monthNamesShort, beforeShowDay, showOtherMonths,
                selectOtherMonths, defaultDate, html, dow, row, group, col, selectedDate,
    Severity: Major
    Found in assets/js/jqueryui.min.js - About 6 hrs to fix

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

              _over: function (event) {
      
                  var draggable = $.ui.ddmanager.current;
                  if (!draggable || (draggable.currentItem || draggable.element)[0] == this.element[0]) return; // Bail if draggable and droppable are same element
      
      
      Severity: Major
      Found in assets/js/jquery-ui-1.8.11.custom.js and 1 other location - About 6 hrs to fix
      assets/js/jquery-ui-1.8.11.custom.js on lines 1889..1899

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

      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

              _out: function (event) {
      
                  var draggable = $.ui.ddmanager.current;
                  if (!draggable || (draggable.currentItem || draggable.element)[0] == this.element[0]) return; // Bail if draggable and droppable are same element
      
      
      Severity: Major
      Found in assets/js/jquery-ui-1.8.11.custom.js and 1 other location - About 6 hrs to fix
      assets/js/jquery-ui-1.8.11.custom.js on lines 1877..1887

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

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

          public function showUser($id)
          {
              global $arr04, $arr05;
              $id = (int)$id;
              if ($GLOBALS['xoopsUser'] && $GLOBALS['xoopsUser'] instanceof \XoopsUser) {
      Severity: Major
      Found in class/Profile.php - About 6 hrs to fix

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

        $.ui.plugin.add("draggable", "opacity", {
            start: function( event, ui, instance ) {
                var t = $( ui.helper ),
                    o = instance.options;
                if (t.css("opacity")) {
        Severity: Major
        Found in assets/js/jqueryui.min.js and 1 other location - About 6 hrs to fix
        assets/js/jqueryui.min.js on lines 2647..2664

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

        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

        $.ui.plugin.add("draggable", "zIndex", {
            start: function( event, ui, instance ) {
                var t = $( ui.helper ),
                    o = instance.options;
        
        
        Severity: Major
        Found in assets/js/jqueryui.min.js and 1 other location - About 6 hrs to fix
        assets/js/jqueryui.min.js on lines 2458..2473

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

        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 jssocials.js has 442 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        /*! jssocials - v1.5.0 - 2017-04-30
        * http://js-socials.com
        * Copyright (c) 2017 Artem Tabalin; Licensed MIT */
        (function(window, $, undefined) {
        
        
        Severity: Minor
        Found in assets/js/jssocials.js - About 6 hrs to fix

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

                          if((this.overflowOffset.top + this.scrollParent[0].offsetHeight) - event.pageY < o.scrollSensitivity) {
                              this.scrollParent[0].scrollTop = scrolled = this.scrollParent[0].scrollTop + o.scrollSpeed;
                          } else if(event.pageY - this.overflowOffset.top < o.scrollSensitivity) {
                              this.scrollParent[0].scrollTop = scrolled = this.scrollParent[0].scrollTop - o.scrollSpeed;
                          }
          Severity: Major
          Found in assets/js/jqueryui.min.js and 1 other location - About 6 hrs to fix
          assets/js/jqueryui.min.js on lines 4793..4797

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

          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((this.overflowOffset.left + this.scrollParent[0].offsetWidth) - event.pageX < o.scrollSensitivity) {
                              this.scrollParent[0].scrollLeft = scrolled = this.scrollParent[0].scrollLeft + o.scrollSpeed;
                          } else if(event.pageX - this.overflowOffset.left < o.scrollSensitivity) {
                              this.scrollParent[0].scrollLeft = scrolled = this.scrollParent[0].scrollLeft - o.scrollSpeed;
                          }
          Severity: Major
          Found in assets/js/jqueryui.min.js and 1 other location - About 6 hrs to fix
          assets/js/jqueryui.min.js on lines 4787..4791

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

          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

                  _formatDate: function (inst, day, month, year) {
                      if (!day) {
                          inst.currentDay = inst.selectedDay;
                          inst.currentMonth = inst.selectedMonth;
                          inst.currentYear = inst.selectedYear;
          Severity: Major
          Found in assets/js/jquery-ui-1.8.11.custom.js and 1 other location - About 6 hrs to fix
          assets/js/jqueryui.min.js on lines 9959..9969

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

          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

              _formatDate: function(inst, day, month, year) {
                  if (!day) {
                      inst.currentDay = inst.selectedDay;
                      inst.currentMonth = inst.selectedMonth;
                      inst.currentYear = inst.selectedYear;
          Severity: Major
          Found in assets/js/jqueryui.min.js and 1 other location - About 6 hrs to fix
          assets/js/jquery-ui-1.8.11.custom.js on lines 9950..9960

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

          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

                  case 'publicindex':
                      $GLOBALS['xoTheme']->addScript($helper->url('assets/js/jquery.oembed.js'));
                      $GLOBALS['xoTheme']->addScript($helper->url('assets/js/jquery.elastic.source.js'));
                      $GLOBALS['xoTheme']->addScript($helper->url('assets/js/wall.js'));
                      $GLOBALS['xoTheme']->addScript($helper->url('assets/js/ajaxupload.3.5.js'));
          Severity: Major
          Found in include/functions.php and 3 other locations - About 6 hrs to fix
          include/functions.php on lines 1414..1427
          include/functions.php on lines 1442..1454
          include/functions.php on lines 1510..1523

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

          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

                  case 'permalink':
                      $GLOBALS['xoTheme']->addScript($helper->url('assets/js/jquery.oembed.js'));
                      $GLOBALS['xoTheme']->addScript($helper->url('assets/js/wall.js'));
                      $GLOBALS['xoTheme']->addStylesheet($helper->url('assets/css/oembed.css'));
                      $GLOBALS['xoTheme']->addStylesheet($helper->url('assets/css/smallworld.css'));
          Severity: Major
          Found in include/functions.php and 3 other locations - About 6 hrs to fix
          include/functions.php on lines 1414..1427
          include/functions.php on lines 1428..1441
          include/functions.php on lines 1510..1523

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

          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

                  case 'register':
                      $GLOBALS['xoTheme']->addScript($helper->url('assets/js/jquery.colorbox.js'));
                      $GLOBALS['xoTheme']->addScript($helper->url('assets/js/jquery.validate.js'));
                      $GLOBALS['xoTheme']->addScript($helper->url('assets/js/jquery.validation.functions.js'));
                      $GLOBALS['xoTheme']->addScript($helper->url('assets/js/jquery.stepy.js'));
          Severity: Major
          Found in include/functions.php and 3 other locations - About 6 hrs to fix
          include/functions.php on lines 1428..1441
          include/functions.php on lines 1442..1454
          include/functions.php on lines 1510..1523

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

          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

                  case 'editprofile':
                      $GLOBALS['xoTheme']->addScript($helper->url('assets/js/jquery.colorbox.js'));
                      $GLOBALS['xoTheme']->addScript($helper->url('assets/js/jquery.validate.js'));
                      $GLOBALS['xoTheme']->addScript($helper->url('assets/js/jquery.validation.functions.js'));
                      $GLOBALS['xoTheme']->addScript($helper->url('assets/js/jquery.stepy.js'));
          Severity: Major
          Found in include/functions.php and 3 other locations - About 6 hrs to fix
          include/functions.php on lines 1414..1427
          include/functions.php on lines 1428..1441
          include/functions.php on lines 1442..1454

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

          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 jquery.form.js has 437 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          /*!
           * jQuery Form Plugin
           * version: 2.43 (12-MAR-2010)
           * @requires jQuery v1.3.2 or later
           *
          Severity: Minor
          Found in assets/js/jquery.form.js - About 6 hrs to fix

            Function fileUpload has 162 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    function fileUpload() {
                        var form = $form[0];
            
                        if ($(':input[name=submit]', form).length) {
                            alert('Error: Form elements must not be named "submit".');
            Severity: Major
            Found in assets/js/jquery.form.js - About 6 hrs to fix

              Function historyCheck has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring.
              Open

                  historyCheck: function () {
                      // if ((xoops_smallworld.browser.msie) && (xoops_smallworld.browser.version < 8)) {
                      if (xoops_smallworld.browser.msie) {
                          // On IE, check for location.hash of iframe
                          var ihistory = xoops_smallworld("#xoops_smallworld_history")[0];
              Severity: Minor
              Found in assets/js/jquery.history.js - About 6 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