XoopsModules25x/smallworld

View on GitHub

Showing 759 of 1,838 total issues

Method insertUpdate has 28 lines of code (exceeds 25 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

    Method smallworld_remDir has 28 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function smallworld_remDir($userid, $directory, $empty = false)
        {
            //@todo verify $userid should be int and then sanitize $userid accordingly before
            //      executing this routine
            if (!empty($userid)) {
    Severity: Minor
    Found in class/SwDatabase.php - About 1 hr to fix

      Function getFileStatus has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
      Open

          public static function getFileStatus($file_path, $original_file_path, $redirectFile)
          {
              global $pathIcon16;
      
              if (empty($file_path)) {
      Severity: Minor
      Found in class/Common/FileChecker.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 SmallworldDeleteDirectory has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
      Open

          public function SmallworldDeleteDirectory($userid)
          {
              $dirname = XOOPS_ROOT_PATH . '/uploads/albums_smallworld' . '/' . $userid . '/';
              if (is_dir($dirname)) {
                  $dir_handle = opendir($dirname);
      Severity: Minor
      Found in class/DoSync.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 Updates has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
      Open

          public function Updates($last, $uid, $followers)
          {
              $uid       = (int)$uid;
              $query     = '';
              $hm        = \XoopsModules\Smallworld\Helper::getInstance()->getConfig('msgtoshow');
      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 SmallworldDeleteDirectory has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
      Open

          public function SmallworldDeleteDirectory($userid)
          {
              $dirname = XOOPS_ROOT_PATH . '/uploads/albums_smallworld' . '/' . (int)$userid . '/';
              if (is_dir($dirname)) {
                  $dir_handle = opendir($dirname);
      Severity: Minor
      Found in class/SwDatabase.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 get_file_object has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
      Open

          protected function get_file_object($file_name)
          {
              if ($this->is_valid_file_object($file_name)) {
                  $file       = new \stdClass();
                  $file->name = $file_name;
      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 _setOption has 27 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          _setOption: function( key, value ) {
              if ( key === "active" ) {
                  // _activate() will handle invalid values and update this.options
                  this._activate( value );
                  return;
      Severity: Minor
      Found in assets/js/jqueryui.min.js - About 1 hr to fix

        Function validate has 27 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            function validate(context, index, opt) {
                if (!context.is('form')) {
                    return true;
                }
        
        
        Severity: Minor
        Found in assets/js/jquery.stepy.js - About 1 hr to fix

          Function top has 27 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  top: function( position, data ) {
                      var within = data.within,
                          withinOffset = within.isWindow ? within.scrollTop : within.offset.top,
                          outerHeight = data.within.height,
                          collisionPosTop = position.top - data.collisionPosition.marginTop,
          Severity: Minor
          Found in assets/js/jqueryui.min.js - About 1 hr to fix

            Function preloadRecursive has 27 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                        preloadRecursive: function (startIndex, currentIndex) {
                            // Check if startIndex has been relocated
                            if (startIndex != this.preloadStartIndex) {
                                var nextIndex = this.getNextIndex(this.preloadStartIndex);
                                return this.preloadRecursive(this.preloadStartIndex, nextIndex);
            Severity: Minor
            Found in assets/js/jquery.galleriffic.js - About 1 hr to fix

              Function getDimensions has 27 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function getDimensions( elem ) {
                  var raw = elem[0];
                  if ( raw.nodeType === 9 ) {
                      return {
                          width: elem.width(),
              Severity: Minor
              Found in assets/js/jqueryui.min.js - About 1 hr to fix

                Function refresh has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    refresh: function() {
                        //See #8237 & #8828
                        var isDisabled = this.element.is( "input, button" ) ? this.element.is( ":disabled" ) : this.element.hasClass( "ui-button-disabled" );
                
                        if ( isDisabled !== this.options.disabled ) {
                Severity: Minor
                Found in assets/js/jqueryui.min.js - About 1 hr to fix

                  Function _updateVirtualBoundaries has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      _updateVirtualBoundaries: function(forceAspectRatio) {
                          var pMinWidth, pMaxWidth, pMinHeight, pMaxHeight, b,
                              o = this.options;
                  
                          b = {
                  Severity: Minor
                  Found in assets/js/jqueryui.min.js - About 1 hr to fix

                    Function left has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

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

                      Function _setupHeightStyle has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          _setupHeightStyle: function( heightStyle ) {
                              var maxHeight,
                                  parent = this.element.parent();
                      
                              if ( heightStyle === "fill" ) {
                      Severity: Minor
                      Found in assets/js/jqueryui.min.js - About 1 hr to fix

                        Function removeTag has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                                removeTag: function (tag, animate) {
                                    animate = typeof animate === 'undefined' ? this.options.animate : animate;
                        
                                    tag = $(tag);
                        
                        
                        Severity: Minor
                        Found in assets/js/tag-it.js - About 1 hr to fix

                          Function setup has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                                  setup: function() {
                          
                                      if ( rformElems.test( this.nodeName ) ) {
                                          // IE doesn't fire change on a check/radio until blur; trigger it on click
                                          // after a propertychange. Eat the blur-change in special.change.handle.
                          Severity: Minor
                          Found in assets/js/jquery.min.js - About 1 hr to fix

                            Function validate_field has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                    function validate_field(id) {
                                        var self = xoops_smallworld(id).attr("id");
                                        var expression = 'function Validate(){' + options['expression'].replace(/VAL/g, 'xoops_smallworld(\'#' + self + '\').val()') + '} Validate()';
                                        var validation_state = eval(expression);
                                        if (!validation_state) {
                            Severity: Minor
                            Found in assets/js/jquery.validate.js - About 1 hr to fix

                              Function propFilter has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              function propFilter( props, specialEasing ) {
                                  var index, name, easing, value, hooks;
                              
                                  // camelCase, specialEasing and expand cssHook pass
                                  for ( index in props ) {
                              Severity: Minor
                              Found in assets/js/jquery.min.js - About 1 hr to fix
                                Severity
                                Category
                                Status
                                Source
                                Language