mambax7/adslight

View on GitHub

Showing 573 of 5,122 total issues

Function handler has 32 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        handler: function( event ) {
            var notAsync, result,
                saved = dataPriv.get( this, type );

            if ( ( event.isTrigger & 1 ) && this[ type ] ) {
Severity: Minor
Found in assets/js/lightbox/js/lightbox-plus-jquery.js - About 1 hr to fix

    Method rssDisplayForum has 32 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function rssDisplayForum(
        $url,
        $size = 15,
        $site = 0,
        $withdate = 0
    Severity: Minor
    Found in admin/adsligh_rsslib.php - About 1 hr to fix

      Method loadTableFromArrayWithReplace has 32 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function loadTableFromArrayWithReplace($table, $data, $search, $replace): int
      {
          /** @var \XoopsMySQLDatabase $db */
          $db = \XoopsDatabaseFactory::getDatabaseConnection();
      
      
      Severity: Minor
      Found in testdata/index.php - About 1 hr to fix

        Method replaceLinks has 32 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function replaceLinks($matches): string
        {
            $req_string = [];
            $add_to_url = '';
            switch ($matches[5]) {
        Severity: Minor
        Found in seo_url.php - About 1 hr to fix

          Method receivePicture has 32 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function receivePicture(
                  $title,
                  $pathUpload,
                  $thumbwidth,
                  $thumbheight,
          Severity: Minor
          Found in class/PicturesHandler.php - About 1 hr to fix

            Method cloneRecord has 32 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public static function cloneRecord(string $tableName, string $idField, int $id): ?int
                {
                    $newId     = null;
                    $tempTable = '';
                    $table     = $GLOBALS['xoopsDB']->prefix($tableName);
            Severity: Minor
            Found in class/Common/SysUtility.php - About 1 hr to fix

              Method processOrderBlockAction has 32 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function processOrderBlockAction(BlockData $blockData)
                  {
                      $blockData->bid           = Request::getArray('bid', []);
                      $blockData->oldtitle      = Request::getArray('oldtitle', [], 'POST');
                      $blockData->oldside       = Request::getArray('oldside', [], 'POST');
              Severity: Minor
              Found in class/Common/BlockActionsHandler.php - About 1 hr to fix

                Method getFileStatus has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public static function getFileStatus($file_path, $original_file_path = null, $redirectFile = null)
                    {
                        global $pathIcon16;
                        $moduleDirName      = \basename(\dirname(__DIR__, 2));
                        $moduleDirNameUpper = \mb_strtoupper($moduleDirName);
                Severity: Minor
                Found in class/Common/FileChecker.php - About 1 hr to fix

                  Function rssDisplayForum has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                  Open

                  function rssDisplayForum(
                      $url,
                      $size = 15,
                      $site = 0,
                      $withdate = 0
                  Severity: Minor
                  Found in admin/adsligh_rsslib.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 adsModCatS has 10 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                      $cidd,
                      $cid,
                      $img,
                      $title,
                      $cat_desc,
                  Severity: Major
                  Found in admin/category.php - About 1 hr to fix

                    Function adslight_search has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                    Open

                    function adslight_search(
                        $queryarray,
                        $andor,
                        $limit,
                        $offset,
                    Severity: Minor
                    Found in include/search.inc.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 resizeImage has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public function resizeImage(
                            $img,
                            $thumbwidth,
                            $thumbheight,
                            $pictwidth,
                    Severity: Minor
                    Found in class/PicturesHandler.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 getModuleOption has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public static function getModuleOption($option, $repmodule = 'adslight')
                        {
                            global $xoopsModule;
                            $helper = \XoopsModules\Adslight\Helper::getInstance();
                            static $tbloptions = [];
                    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

                    Function rrmdir has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public static function rrmdir(string $src): bool
                        {
                            // 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 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 makeAdSelBox has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public function makeAdSelBox($title, $order = '', $preset_id = 0, $none = 0, $sel_name = '', $onchange = ''): void
                        {
                            global $myts, $xoopsDB;
                            $helper     = Helper::getInstance();
                            $pathIcon16 = Admin::iconUrl('', '16');
                    Severity: Minor
                    Found in class/Tree.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 load has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    jQuery.fn.load = function( url, params, callback ) {
                        var selector, type, response,
                            self = this,
                            off = url.indexOf( " " );
                    
                    
                    Severity: Minor
                    Found in assets/js/lightbox/js/lightbox-plus-jquery.js - About 1 hr to fix

                      Function removeWidget has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                              removeWidget : function( table, name, refreshing ) {
                                  table = $( table )[ 0 ];
                                  var index, widget, indx, len,
                                      c = table.config;
                                  // if name === true, add all widgets from $.tablesorter.widgets
                      Severity: Minor
                      Found in assets/js/tablesorter/js/jquery.tablesorter.combined.js - About 1 hr to fix

                        Method listingAddcondition has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        function listingAddcondition($type): void
                        {
                            global $xoopsDB, $xoopsConfig, $myts, $admin_lang;
                            $helper = Helper::getInstance();
                            $type   = \htmlspecialchars($type, ENT_QUOTES | ENT_HTML5);
                        Severity: Minor
                        Found in admin/options.php - About 1 hr to fix

                          Function removeWidget has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                                  removeWidget : function( table, name, refreshing ) {
                                      table = $( table )[ 0 ];
                                      var index, widget, indx, len,
                                          c = table.config;
                                      // if name === true, add all widgets from $.tablesorter.widgets
                          Severity: Minor
                          Found in assets/js/tablesorter/js/jquery.tablesorter.js - About 1 hr to fix

                            Method getServerStats has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                public static function getServerStats(): string
                                {
                                    //mb    $wfdownloads = WfdownloadsWfdownloads::getInstance();
                                    $moduleDirName      = \basename(\dirname(__DIR__, 2));
                                    $moduleDirNameUpper = \mb_strtoupper($moduleDirName);
                            Severity: Minor
                            Found in class/Common/ServerStats.php - About 1 hr to fix
                              Severity
                              Category
                              Status
                              Source
                              Language