XoopsModules25x/smallworld

View on GitHub

Showing 759 of 1,838 total issues

Method smallworld_time_stamp has 48 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function smallworld_time_stamp($session_time)
{
    $time_difference = time() - $session_time;
    $seconds         = $time_difference;
    $minutes         = round($time_difference / 60);
Severity: Minor
Found in include/functions.php - About 1 hr to fix

    Function handle_file_upload has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
    Open

        private function handle_file_upload($uploaded_file, $name, $size, $type, $error)
        {
            $file   = new \stdClass();
            $swDB   = new SwDatabase();
            $userid = ($GLOBALS['xoopsUser'] && ($GLOBALS['xoopsUser'] instanceof \XoopsUser)) ? $GLOBALS['xoopsUser']->uid() : 0;
    Severity: Minor
    Found in class/SwUploadHandler.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 createAlbum has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
    Open

        public function createAlbum($userId)
        {
            //@todo change $dir to XOOPS_UPLOAD_PATH . /smallworld/albums/[$userId]
            $dir = XOOPS_UPLOAD_PATH . '/albums_smallworld';
            if (!file_exists($dir . '/' . $userId . '/thumbnails') || !file_exists($dir . '/' . $userId . '/')) {
    Severity: Minor
    Found in class/Images.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 addImage has 47 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

                addImage: function (listItem, thumbExists, insert, position) {
                    var xoops_smallworldli = (typeof listItem === "string") ? xoops_smallworld(listItem) : listItem;
                    var xoops_smallworldaThumb = xoops_smallworldli.find('a.thumb');
                    var slideUrl = xoops_smallworldaThumb.attr('href');
                    var title = xoops_smallworldaThumb.attr('title');
    Severity: Minor
    Found in assets/js/jquery.galleriffic.js - About 1 hr to fix

      Function scale has 47 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      var effectScale = $.effects.effect.scale = function( o, done ) {
      
          // Create element
          var el = $( this ),
              options = $.extend( true, {}, o ),
      Severity: Minor
      Found in assets/js/jqueryui.min.js - About 1 hr to fix

        Function internalData has 47 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function internalData( elem, name, data, pvt /* Internal Use Only */ ) {
            if ( !jQuery.acceptData( elem ) ) {
                return;
            }
        
        
        Severity: Minor
        Found in assets/js/jquery.min.js - About 1 hr to fix

          Function select has 47 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          select = Sizzle.select = function( selector, context, results, seed ) {
              var i, tokens, token, type, find,
                  compiled = typeof selector === "function" && selector,
                  match = !seed && tokenize( (selector = compiled.selector || selector) );
          
          
          Severity: Minor
          Found in assets/js/jquery.min.js - About 1 hr to fix

            Function source has 47 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    source: function (_request, _response) {
                        if (_request.term in this.options._cache) {
                            _response(this.options._cache[_request.term]);
                        } else {
                            var self = this;
            Severity: Minor
            Found in assets/js/ui.geo_autocomplete_now.js - About 1 hr to fix

              Function _generatePosition has 46 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  _generatePosition: function(event) {
              
                      var top, left,
                          o = this.options,
                          pageX = event.pageX,
              Severity: Minor
              Found in assets/js/jqueryui.min.js - About 1 hr to fix

                Function bridge has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                $.widget.bridge = function( name, object ) {
                    var fullName = object.prototype.widgetFullName || name;
                    $.fn[ name ] = function( options ) {
                        var isMethodCall = typeof options === "string",
                            args = widget_slice.call( arguments, 1 ),
                Severity: Minor
                Found in assets/js/jqueryui.min.js - About 1 hr to fix

                  Function _createWrapper has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      _createWrapper: function() {
                          this.uiDialog = $("<div>")
                              .addClass( "ui-dialog ui-widget ui-widget-content ui-corner-all ui-front " +
                                  this.options.dialogClass )
                              .hide()
                  Severity: Minor
                  Found in assets/js/jqueryui.min.js - About 1 hr to fix

                    Function _toggle has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        _toggle: function( event, eventData ) {
                            var that = this,
                                toShow = eventData.newPanel,
                                toHide = eventData.oldPanel;
                    
                    
                    Severity: Minor
                    Found in assets/js/jqueryui.min.js - About 1 hr to fix

                      Function fold has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      var effectFold = $.effects.effect.fold = function( o, done ) {
                      
                          // Create element
                          var el = $( this ),
                              props = [ "position", "top", "bottom", "left", "right", "height", "width" ],
                      Severity: Minor
                      Found in assets/js/jqueryui.min.js - About 1 hr to fix

                        Function tokenize has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        tokenize = Sizzle.tokenize = function( selector, parseOnly ) {
                            var matched, match, tokens, type,
                                soFar, groups, preFilters,
                                cached = tokenCache[ selector + " " ];
                        
                        
                        Severity: Minor
                        Found in assets/js/jquery.min.js - About 1 hr to fix

                          Function matcherFromTokens has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          function matcherFromTokens( tokens ) {
                              var checkContext, matcher, j,
                                  len = tokens.length,
                                  leadingRelative = Expr.relative[ tokens[0].type ],
                                  implicitRelative = leadingRelative || Expr.relative[" "],
                          Severity: Minor
                          Found in assets/js/jquery.min.js - About 1 hr to fix

                            Function historyCheck has 46 lines of code (exceeds 25 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 1 hr to fix

                              Function explode has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  $.effects.explode = function (o) {
                              
                                      return this.queue(function () {
                              
                                          var rows = o.options.pieces ? Math.round(Math.sqrt(o.options.pieces)) : 3;
                              Severity: Minor
                              Found in assets/js/jquery-ui-1.8.11.custom.js - About 1 hr to fix

                                Method smallworld_userDefaultNull has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                function smallworld_userDefaultNull()
                                {    
                                    global $xoopsDB;
                                    $sql = "ALTER TABLE  " . $xoopsDB->prefix('smallworld_user') . " CHANGE `id` `id` INT(5) UNSIGNED NOT NULL AUTO_INCREMENT, 
                                    CHANGE `userimage` `userimage` TEXT CHARACTER SET utf8 COLLATE utf8_general_ci NULL, 
                                Severity: Minor
                                Found in admin/upgrade.php - About 1 hr to fix

                                  Method getDirectoryStatus has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      public static function getDirectoryStatus($path, $mode = 0777, $redirectFile = null)
                                      {
                                          global $pathIcon16;
                                  
                                          if (empty($path)) {
                                  Severity: Minor
                                  Found in class/Common/DirectoryChecker.php - About 1 hr to fix

                                    Method smallworld_SetCoreScript has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                    function smallworld_SetCoreScript()
                                    {
                                        /** @var \XoopsModules\Smallworld\Helper $helper */
                                        $helper = Helper::getInstance();
                                    
                                    
                                    Severity: Minor
                                    Found in include/functions.php - About 1 hr to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language