mambax7/adslight

View on GitHub

Showing 573 of 5,122 total issues

Function format has 36 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        format: function(table, c, wo, init) {
            var time,
                $table = c.$table,
                saveSort = wo.saveSort !== false, // make saveSort active/inactive; default to true
                sortList = { 'sortList' : c.sortList },
Severity: Minor
Found in assets/js/tablesorter/js/jquery.tablesorter.widgets.js - About 1 hr to fix

    Method adslight_show has 36 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function adslight_show($options)
    {
        if (!class_exists(Helper::class)) {
            return [];
        }
    Severity: Minor
    Found in blocks/ads.php - About 1 hr to fix

      Function xcopy has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
      Open

          public static function xcopy($source, $dest): bool
          {
              // 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 render has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
      Open

          public function render(?array $block = null): void
          {
              \xoops_load('XoopsFormLoader');
              \xoops_loadLanguage('common', $this->moduleDirNameUpper);
      
      
      Severity: Minor
      Found in class/Common/Blocksadmin.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 getTotalItems has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
      Open

          public static function getTotalItems($sel_id, $status = ''): int
          {
              global $xoopsDB, $mytree;
              $categories = self::getMyItemIds('adslight_view');
              $count      = 0;
      Severity: Minor
      Found in class/Utility.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 resizeImage has 35 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function resizeImage(
              $img,
              $thumbwidth,
              $thumbheight,
              $pictwidth,
      Severity: Minor
      Found in class/PicturesHandler.php - About 1 hr to fix

        Method orderBlock has 35 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function orderBlock(
                array $bid,
                array $oldtitle,
                array $oldside,
                array $oldweight,
        Severity: Minor
        Found in class/Common/Blocksadmin.php - About 1 hr to fix

          Method delReply has 35 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function delReply($r_lid, $ok): void
          {
              global $xoopsDB;
              $helper = Helper::getInstance();
              $sql    = 'SELECT l.usid, r.r_lid, r.lid, r.title, r.date_created, r.submitter, r.message, r.tele, r.email, r.r_usid FROM ' . $xoopsDB->prefix(
          Severity: Minor
          Found in modify.php - About 1 hr to fix

            Function setOffset has 34 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                setOffset: function( elem, options, i ) {
                    var curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition,
                        position = jQuery.css( elem, "position" ),
                        curElem = jQuery( elem ),
                        props = {};
            Severity: Minor
            Found in assets/js/lightbox/js/lightbox-plus-jquery.js - About 1 hr to fix

              Function getWidthOrHeight has 34 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function getWidthOrHeight( elem, dimension, extra ) {
              
                  // Start with computed style
                  var styles = getStyles( elem ),
              
              
              Severity: Minor
              Found in assets/js/lightbox/js/lightbox-plus-jquery.js - About 1 hr to fix

                Function handlers has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    handlers: function( event, handlers ) {
                        var i, handleObj, sel, matchedHandlers, matchedSelectors,
                            handlerQueue = [],
                            delegateCount = handlers.delegateCount,
                            cur = event.target;
                Severity: Minor
                Found in assets/js/lightbox/js/lightbox-plus-jquery.js - About 1 hr to fix

                  Function setHandlePosition has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          setHandlePosition : function( c, wo ) {
                              var startPosition,
                                  tableHeight = c.$table.height(),
                                  $handles = wo.$resizable_container.children(),
                                  handleCenter = Math.floor( $handles.width() / 2 );
                  Severity: Minor
                  Found in assets/js/tablesorter/js/jquery.tablesorter.widgets.js - About 1 hr to fix

                    Function setHandlePosition has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                            setHandlePosition : function( c, wo ) {
                                var startPosition,
                                    tableHeight = c.$table.height(),
                                    $handles = wo.$resizable_container.children(),
                                    handleCenter = Math.floor( $handles.width() / 2 );
                    Severity: Minor
                    Found in assets/js/tablesorter/js/jquery.tablesorter.combined.js - About 1 hr to fix

                      Method tips_writing has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      function tips_writing(): void
                      {
                          global $xoopsDB, $xoopsConfig, $xoopsModule, $xoopsTpl, $myts, $mytree, $meta, $mid, $prem_perm;
                          $helper                                  = Helper::getInstance();
                          $GLOBALS['xoopsOption']['template_main'] = 'adslight_tips_writing_ad.tpl';
                      Severity: Minor
                      Found in tips_writing_ad.php - About 1 hr to fix

                        Consider simplifying this complex logical expression.
                        Open

                                        } else if ( this.value !== '' && (
                                            // liveSearch can contain a min value length; ignore arrow and meta keys, but allow backspace
                                            ( typeof liveSearch === 'number' && this.value.length < liveSearch ) ||
                                            // let return & backspace continue on, but ignore arrows & non-valid characters
                                            ( event.which !== tskeyCodes.enter && event.which !== tskeyCodes.backSpace &&
                        Severity: Critical
                        Found in assets/js/tablesorter/js/jquery.tablesorter.widgets.js - About 1 hr to fix

                          Consider simplifying this complex logical expression.
                          Open

                                          if ( ( tsfRegex.orTest.test( data.iFilter ) || tsfRegex.orSplit.test( data.filter ) ) &&
                                              // this test for regex has potential to slow down the overall search
                                              !tsfRegex.regex.test( data.filter ) ) {
                                              var indx, filterMatched, query, regex,
                                                  // duplicate data but split filter
                          Severity: Critical
                          Found in assets/js/tablesorter/js/jquery.tablesorter.widgets.js - About 1 hr to fix

                            Consider simplifying this complex logical expression.
                            Open

                                            } else if ( this.value !== '' && (
                                                // liveSearch can contain a min value length; ignore arrow and meta keys, but allow backspace
                                                ( typeof liveSearch === 'number' && this.value.length < liveSearch ) ||
                                                // let return & backspace continue on, but ignore arrows & non-valid characters
                                                ( event.which !== tskeyCodes.enter && event.which !== tskeyCodes.backSpace &&
                            Severity: Critical
                            Found in assets/js/tablesorter/js/jquery.tablesorter.combined.js - About 1 hr to fix

                              Consider simplifying this complex logical expression.
                              Open

                                              if ( ( tsfRegex.orTest.test( data.iFilter ) || tsfRegex.orSplit.test( data.filter ) ) &&
                                                  // this test for regex has potential to slow down the overall search
                                                  !tsfRegex.regex.test( data.filter ) ) {
                                                  var indx, filterMatched, query, regex,
                                                      // duplicate data but split filter
                              Severity: Critical
                              Found in assets/js/tablesorter/js/jquery.tablesorter.combined.js - About 1 hr to fix

                                Function showHide has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                function showHide( elements, show ) {
                                    var display, elem,
                                        values = [],
                                        index = 0,
                                        length = elements.length;
                                Severity: Minor
                                Found in assets/js/lightbox/js/lightbox-plus-jquery.js - About 1 hr to fix

                                  Method getAllPictures has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      public function getAllPictures(
                                          $criteria = [],
                                          $asobject = false,
                                          $sort = 'cod_img',
                                          $cat_order = 'ASC',
                                  Severity: Minor
                                  Found in class/Pictures.php - About 1 hr to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language