XoopsModules25x/smallworld

View on GitHub

Showing 759 of 1,838 total issues

Function show has 45 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        show: function () {
            if (!this.isShown && this.$element.hasClass('modal-gallery')) {
                var modal = this.$element,
                    options = this.options,
                    windowWidth = $(window).width(),
Severity: Minor
Found in assets/js/uploader/bootstrap-image-gallery.js - About 1 hr to fix

    Function _tabKeydown has 45 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        _tabKeydown: function( event ) {
            var focusedTab = $( this.document[0].activeElement ).closest( "li" ),
                selectedIndex = this.tabs.index( focusedTab ),
                goingForward = true;
    
    
    Severity: Minor
    Found in assets/js/jqueryui.min.js - About 1 hr to fix

      Function _destroy has 45 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          _destroy: function() {
              if ( this.xhr ) {
                  this.xhr.abort();
              }
      
      
      Severity: Minor
      Found in assets/js/jqueryui.min.js - About 1 hr to fix

        Function renderImageToCanvas has 44 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            loadImage.renderImageToCanvas = function (img, canvas, width, height) {
                var iw = img.width,
                    ih = img.height,
                    ctx = canvas.getContext('2d'),
                    vertSquashRatio,
        Severity: Minor
        Found in assets/js/uploader/load-image.js - About 1 hr to fix

          Function buildPager has 44 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                      buildPager: function (pager) {
                          var gallery = this;
                          var numPages = this.getNumPages();
                          var page = this.getCurrentPage();
                          var startIndex = page * this.numThumbs;
          Severity: Minor
          Found in assets/js/jquery.galleriffic.js - About 1 hr to fix

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

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

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

                    private function handle_file_upload($uploaded_file, $name, $size, $type, $error)
                    {
                        global $xoopsUser;
                        $file   = new stdClass();
                        $db     = new SmallWorldDB;
                Severity: Minor
                Found in class/uploadclass.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 xcopy has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                Open

                    public static function xcopy($source, $dest)
                    {
                        // Check for symlinks
                        if (is_link($source)) {
                            return symlink(readlink($source), $dest);
                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 mergeImage has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function mergeImage()
                    {
                        $dest = imagecreatefromjpeg($this->endFile);
                        $src  = imagecreatefromjpeg($this->sourceFile);
                        if (4 == $this->mergeType) {
                Severity: Minor
                Found in class/Common/Resizer.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 name has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

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

                  Function show has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          , show: function () {
                              var $tip
                                  , inside
                                  , pos
                                  , actualWidth
                  Severity: Minor
                  Found in assets/js/uploader/bootstrap.js - About 1 hr to fix

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

                        refresh: function() {
                            var menus, items,
                                that = this,
                                icon = this.options.icons.submenu,
                                submenus = this.element.find( this.options.menus );
                    Severity: Minor
                    Found in assets/js/jqueryui.min.js - About 1 hr to fix

                      Function _drawMenu has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          _drawMenu: function() {
                              var that = this;
                      
                              // Create menu
                              this.menu = $( "<ul>", {
                      Severity: Minor
                      Found in assets/js/jqueryui.min.js - About 1 hr to fix

                        Function OEmbedProvider has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            xoops_smallworld.fn.oembed.OEmbedProvider = function (name, type, urlschemesarray, apiendpoint, extraSettings) {
                                this.name = name;
                                this.type = type; // "photo", "video", "link", "rich", null
                                this.urlschemes = urlschemesarray;
                                this.apiendpoint = apiendpoint;
                        Severity: Minor
                        Found in assets/js/jquery.oembed.js - About 1 hr to fix

                          Function appendHTML has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              function appendHTML() {
                                  if (!$box && document.body) {
                                      init = false;
                          
                                      $window = $(window);
                          Severity: Minor
                          Found in assets/js/jquery.colorbox.js - About 1 hr to fix

                            Function shake has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

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

                              Function _onAdd has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                      _onAdd: function (e, data) {
                                          var that = this,
                                              result = true,
                                              options = $.extend({}, this.options, data),
                                              limit = options.limitMultiFileUploads,
                              Severity: Minor
                              Found in assets/js/jquery.fileupload.js - About 1 hr to fix

                                Function _makeResizable has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                        _makeResizable: function (handles) {
                                            handles = (handles === undefined ? this.options.resizable : handles);
                                            var self = this,
                                                options = self.options,
                                                // .ui-resizable has position: relative defined in the stylesheet
                                Severity: Minor
                                Found in assets/js/jquery-ui-1.8.11.custom.js - About 1 hr to fix

                                  Function _contactContainers has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                          _contactContainers: function (event) {
                                  
                                              // get innermost container that intersects with item
                                              var innermostContainer = null, innermostIndex = null;
                                  
                                  
                                  Severity: Minor
                                  Found in assets/js/jquery-ui-1.8.11.custom.js - About 1 hr to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language