XoopsModules25x/smallworld

View on GitHub

Showing 759 of 1,838 total issues

Function _refreshItems has 32 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        _refreshItems: function (event) {

            this.items = [];
            this.containers = [this];
            var items = this.items;
Severity: Minor
Found in assets/js/jquery-ui-1.8.11.custom.js - About 1 hr to fix

    Function _hideDatepicker has 32 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            _hideDatepicker: function (input) {
                var inst = this._curInst;
                if (!inst || (input && inst != $.data(input, PROP_NAME)))
                    return;
                if (this._datepickerShowing) {
    Severity: Minor
    Found in assets/js/jquery-ui-1.8.11.custom.js - About 1 hr to fix

      Method smallworld_tolink has 32 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function smallworld_tolink($text, $uid)
      {
          $helper = Helper::getInstance();
          $ext        = mb_substr($text, -4, 4);
          $ext2       = mb_substr($text, -5, 5);
      Severity: Minor
      Found in include/functions.php - About 1 hr to fix

        Method array_to_json has 32 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function array_to_json($array)
        {
            if (!is_array($array)) {
                return false;
            }
        Severity: Minor
        Found in tags.php - About 1 hr to fix

          Function smallworld_includeScripts has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
          Open

          function smallworld_includeScripts()
          {
              /** @var \XoopsModules\Smallworld\Helper $helper */
              $helper = Helper::getInstance();
              $page = basename($_SERVER['PHP_SELF'], '.php');
          Severity: Minor
          Found in include/functions.php - About 1 hr 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 smallworld_sociallinks has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
          Open

          function smallworld_sociallinks($num, $name)
          {
              /** @var \XoopsModules\Smallworld\Helper $helper */
              $helper = Helper::getInstance();
              switch ($num) {
          Severity: Minor
          Found in include/functions.php - About 1 hr 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 smallworld_getAvatarLink has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
          Open

          function smallworld_getAvatarLink($userid, $image)
          {
              $depMsg = __FUNCTION__ . " is deprecated use SwUserHandler::getAvatarLink() instead.";
              if (isset($GLOBALS['xoopsLogger'])) {
                  $GLOBALS['xoopsLogger']->addDeprecated($depMsg);
          Severity: Minor
          Found in include/functions.php - About 1 hr 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 friendcheck has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
          Open

              public function friendcheck($user, $userId)
              {
                  $respons = [0 => '']; // init response
                  if ($user == $userId) {
                      $respons[0] = 2;
          Severity: Minor
          Found in class/User.php - About 1 hr 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 school_add has 10 arguments (exceeds 4 allowed). Consider refactoring.
          Open

                  $class,
                  $name,
                  $name2,
                  $rel,
                  array $options,
          Severity: Major
          Found in class/Form.php - About 1 hr to fix

            Method job has 10 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                    $class,
                    $name,
                    $name2,
                    $rel,
                    $textmore,
            Severity: Major
            Found in class/Form.php - About 1 hr to fix

              Function delete has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function delete($print_response = true)
                  {
                      $userid    = $GLOBALS['xoopsUser']->getVar('uid');
                      $swDB      = new SwDatabase();
                      $file_name = $this->get_file_name_param();
              Severity: Minor
              Found in class/UploadHandler.php - About 1 hr 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 insertUpdate has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function insertUpdate($uid, $update, $priv = 0)
                  {
                      $uid    = (int)$uid;
                      $priv   = (int)$priv;
                      $update = smallworld_sanitize(htmlentities($update, ENT_QUOTES, 'UTF-8'));
              Severity: Minor
              Found in class/WallUpdates.php - About 1 hr 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 xoops_module_update_smallworld has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
              Open

              function xoops_module_update_smallworld(\XoopsModule $module)
              {
                  $tables = new \Xmf\Database\Tables();
              
                  $cTable   = 'config';
              Severity: Minor
              Found in include/onupdate.php - About 1 hr 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 rrmdir has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
              Open

                  public static function rrmdir($src)
                  {
                      // Only continue if user is a 'global' Admin
                      if (!($GLOBALS['xoopsUser'] instanceof \XoopsUser) || !$GLOBALS['xoopsUser']->isAdmin()) {
                          return false;
              Severity: Minor
              Found in class/Common/FilesManagement.php - About 1 hr 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 left has 31 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      left: function( position, data ) {
                          var within = data.within,
                              withinOffset = within.offset.left + within.scrollLeft,
                              outerWidth = within.width,
                              offsetLeft = within.isWindow ? within.scrollLeft : within.offset.left,
              Severity: Minor
              Found in assets/js/jqueryui.min.js - About 1 hr to fix

                Function _attachHandlers has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    _attachHandlers: function(inst) {
                        var stepMonths = this._get(inst, "stepMonths"),
                            id = "#" + inst.id.replace( /\\\\/g, "\\" );
                        inst.dpDiv.find("[data-handler]").map(function () {
                            var handler = {
                Severity: Minor
                Found in assets/js/jqueryui.min.js - About 1 hr to fix

                  Function SmallworldGetMoreMsg has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function SmallworldGetMoreMsg() {
                      xoops_smallworld('.smallworld_msg_counter:last').show();
                      xoops_smallworld('.smallworld_msg_counter').on('click', function (e) {
                          e.preventDefault();
                          xoops_smallworld('#smallworld_moremsg_ajax').show();
                  Severity: Minor
                  Found in assets/js/smallworld.js - About 1 hr to fix

                    Function offsetString has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                                offsetString = function(offset) {
                                    try {
                                        return $.datepicker.parseDate($.datepicker._get(inst, "dateFormat"),
                                            offset, $.datepicker._getFormatConfig(inst));
                                    }
                    Severity: Minor
                    Found in assets/js/jqueryui.min.js - About 1 hr to fix

                      Function ajaxForm has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          $.fn.ajaxForm = function (options) {
                              return this.ajaxFormUnbind().bind('submit.form-plugin', function (e) {
                                  e.preventDefault();
                                  $(this).ajaxSubmit(options);
                              }).bind('click.form-plugin', function (e) {
                      Severity: Minor
                      Found in assets/js/jquery.form.js - About 1 hr to fix

                        Function option has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            option: function( key, value ) {
                                var options = key,
                                    parts,
                                    curOption,
                                    i;
                        Severity: Minor
                        Found in assets/js/jqueryui.min.js - About 1 hr to fix
                          Severity
                          Category
                          Status
                          Source
                          Language