XoopsModules25x/smallworld

View on GitHub

Showing 759 of 1,838 total issues

Function formToWizard has 64 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    xoops_smallworld.fn.formToWizard = function (options) {
        options = xoops_smallworld.extend({
            submitButton: ""
        }, options);

Severity: Major
Found in assets/js/formToWizard.js - About 2 hrs to fix

    Function bounce has 64 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    var effectBounce = $.effects.effect.bounce = function( o, done ) {
        var el = $( this ),
            props = [ "position", "top", "bottom", "left", "right", "height", "width" ],
    
            // defaults:
    Severity: Major
    Found in assets/js/jqueryui.min.js - About 2 hrs to fix

      Function resize has 63 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          resize: function() {
              var outerDimensions,
                  that = $(this).resizable( "instance" ),
                  o = that.options,
                  cs = that.size,
      Severity: Major
      Found in assets/js/jqueryui.min.js - About 2 hrs to fix

        Function _mouseStart has 63 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                _mouseStart: function (event, overrideHandle, noActivation) {
        
                    var o = this.options, self = this;
                    this.currentContainer = this;
        
        
        Severity: Major
        Found in assets/js/jquery-ui-1.8.11.custom.js - About 2 hrs to fix

          Method truncateHtml has 63 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public static function truncateHtml($text, $length = 100, $ending = '...', $exact = false, $considerHtml = true)
              {
                  if ($considerHtml) {
                      // if the plain text is shorter than the maximum length, return the whole text
                      if (mb_strlen(preg_replace('/<.*?' . '>/', '', $text)) <= $length) {
          Severity: Major
          Found in class/Common/SysUtility.php - About 2 hrs to fix

            Method fetchURL has 62 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function fetchURL($url, $methods = ['fopen', 'curl', 'socket'])
                {
                    /**
                     *   December 21st 2010, Mathew Tinsley (tinsley@tinsology.net)
                     *   http://tinsology.net
            Severity: Major
            Found in class/Admin.php - About 2 hrs to fix

              Function _showDatepicker has 61 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  _showDatepicker: function(input) {
                      input = input.target || input;
                      if (input.nodeName.toLowerCase() !== "input") { // find from button/image trigger
                          input = $("input", input.parentNode)[0];
                      }
              Severity: Major
              Found in assets/js/jqueryui.min.js - About 2 hrs to fix

                Function superMatcher has 61 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        superMatcher = function( seed, context, xml, results, outermost ) {
                            var elem, j, matcher,
                                matchedCount = 0,
                                i = "0",
                                unmatched = seed && [],
                Severity: Major
                Found in assets/js/jquery.min.js - About 2 hrs to fix

                  Function fail has 61 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                              fail: function (e, data) {
                                  var that = $(this).data('blueimp-fileupload') ||
                                      $(this).data('fileupload'),
                                      template,
                                      deferred;
                  Severity: Major
                  Found in assets/js/jquery.fileupload-ui.js - About 2 hrs to fix

                    Function _generateMonthYearHeader has 61 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                            _generateMonthYearHeader: function (inst, drawMonth, drawYear, minDate, maxDate,
                                                                secondary, monthNames, monthNamesShort) {
                                var changeMonth = this._get(inst, 'changeMonth');
                                var changeYear = this._get(inst, 'changeYear');
                                var showMonthAfterYear = this._get(inst, 'showMonthAfterYear');
                    Severity: Major
                    Found in assets/js/jquery-ui-1.8.11.custom.js - About 2 hrs to fix

                      Method smallworld_search has 61 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      function smallworld_search($queryarray, $andor, $limit, $offset, $userid, $sortby = 'created DESC')
                      {
                          $moduleDirName = basename(dirname(__DIR__));
                      
                          if (file_exists(XOOPS_ROOT_PATH . '/modules/smallworld/language/' . $GLOBALS['xoopsConfig']['language'] . '/main.php')) {
                      Severity: Major
                      Found in include/search.inc.php - About 2 hrs to fix

                        Function deleteDirectory has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
                        Open

                            public static function deleteDirectory($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 2 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 create_scaled_image has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
                        Open

                            protected function create_scaled_image($file_name, $version, $options)
                            {
                                $file_path = $this->get_upload_path($file_name);
                                if (!empty($version)) {
                                    $version_dir = $this->get_upload_path(null, $version);
                        Severity: Minor
                        Found in class/UploadHandler.php - About 2 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 keydown has 60 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                                keydown: function( event ) {
                                    var allowed, curVal, newVal, step,
                                        index = $( event.target ).data( "ui-slider-handle-index" );
                        
                                    switch ( event.keyCode ) {
                        Severity: Major
                        Found in assets/js/jqueryui.min.js - About 2 hrs to fix

                          Function submit has 60 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                                  submit: function () {
                                      var self = this, settings = this._settings;
                          
                                      if (this._input.value === '') {
                                          // there is no file
                          Severity: Major
                          Found in assets/js/ajaxupload.3.5.js - About 2 hrs to fix

                            Function init has 60 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                init = jQuery.fn.init = function( selector, context ) {
                                    var match, elem;
                            
                                    // HANDLE: $(""), $(null), $(undefined), $(false)
                                    if ( !selector ) {
                            Severity: Major
                            Found in assets/js/jquery.min.js - About 2 hrs to fix

                              Function domManip has 60 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  domManip: function( args, callback ) {
                              
                                      // Flatten any nested arrays
                                      args = concat.apply( [], args );
                              
                              
                              Severity: Major
                              Found in assets/js/jquery.min.js - About 2 hrs to fix

                                Function send has 60 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                                send: function( headers, complete ) {
                                                    var i,
                                                        xhr = options.xhr(),
                                                        id = ++xhrId;
                                
                                
                                Severity: Major
                                Found in assets/js/jquery.min.js - About 2 hrs to fix

                                  Function drag has 59 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      drag: function( event, ui, inst ) {
                                  
                                          var ts, bs, ls, rs, l, r, t, b, i, first,
                                              o = inst.options,
                                              d = o.snapTolerance,
                                  Severity: Major
                                  Found in assets/js/jqueryui.min.js - About 2 hrs to fix

                                    Function cb has 59 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                                function cb() {
                                                    if (cbInvoked)
                                                        return;
                                    
                                                    var ok = true;
                                    Severity: Major
                                    Found in assets/js/jquery.form.js - About 2 hrs to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language