XoopsModules25x/rss

View on GitHub

Showing 80 of 101 total issues

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

    public function grabEntries(\XoopsMySQLDatabase $xoopsDB): ?array
    {
        $ret  = null;

        $i        = -1;
Severity: Minor
Found in class/Plugins/Surnames.php - About 1 hr to fix

    Method insert has 44 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function insert(\XoopsObject $object, $force = true)
        {
            if (mb_strtolower(\get_class($object)) != mb_strtolower($this->objClass)) {
                return false;
            }
    Severity: Minor
    Found in class/PluginHandler.php - About 1 hr to fix

      Method insert has 44 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function insert(\XoopsObject $object, $force = false)
          {
              //        $force = false;
              if (mb_strtolower(\get_class($object)) != mb_strtolower($this->objClass)) {
                  return false;
      Severity: Minor
      Found in class/MiscHandler.php - About 1 hr to fix

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

            public function grabEntries(\XoopsMySQLDatabase $xoopsDB):?array
            {
                $myts = \MyTextSanitizer::getInstance();
                $ret  = null;
        
        
        Severity: Minor
        Found in class/Plugins/legacy/Queries.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 grabEntries has 43 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function grabEntries(\XoopsMySQLDatabase $xoopsDB): ?array
            {
                $ret  = null;
                $i = 0;
        
        
        Severity: Minor
        Found in class/Plugins/Extcal.php - About 1 hr to fix

          Method getObjects2 has 43 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function getObjects2($criteria = null, string $fields = '*', string $key = ''): ?array
              {
                  $ret   = null;
                  $limit = $start = 0;
                  switch ($fields) {
          Severity: Minor
          Found in class/PluginHandler.php - About 1 hr to fix

            Method rssfInsertChannel has 43 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function rssfInsertChannel(\XoopsModule $xoopsMod): string
            {
                global $xoopsDB, $xoopsConfig;
                $helper = Rssfit\Helper::getInstance();
                $url = $xoopsDB->quoteString(XOOPS_URL);
            Severity: Minor
            Found in include/install.php - About 1 hr to fix

              Method checkVerModule has 42 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public static function checkVerModule(Helper $helper, ?string $source = 'github', ?string $default = 'master'): ?array
                  {
                      $moduleDirName      = \basename(\dirname(__DIR__, 2));
                      $moduleDirNameUpper = mb_strtoupper($moduleDirName);
                      $update             = '';
              Severity: Minor
              Found in class/Common/VersionChecks.php - About 1 hr to fix

                Function loadTableFromArrayWithReplace has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                Open

                function loadTableFromArrayWithReplace(string $table, array $data, string $search, string $replace): int
                {
                    /** @var \XoopsMySQLDatabase $db */
                    $db = \XoopsDatabaseFactory::getDatabaseConnection();
                
                
                Severity: Minor
                Found in testdata/index.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 getObjects2 has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function getObjects2($criteria = null, string $fields = '*', string $key = ''): ?array
                    {
                        $ret   = null;
                        $start = 0;
                        $limit = $start;
                Severity: Minor
                Found in class/MiscHandler.php - About 1 hr to fix

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

                      public function getObjects2($criteria = null, string $fields = '*', string $key = ''): ?array
                      {
                          $ret   = null;
                          $start = 0;
                          $limit = $start;
                  Severity: Minor
                  Found in class/MiscHandler.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 grabEntries has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function grabEntries(\XoopsMySQLDatabase $xoopsDB): ?array
                      {
                          $myts = \MyTextSanitizer::getInstance();
                          $ret  = null;
                          $i    = 0;
                  Severity: Minor
                  Found in class/Plugins/Myalbum.php - About 1 hr to fix

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

                        public function grabEntries(\XoopsMySQLDatabase $xoopsDB):?array
                        {
                            $myts = \MyTextSanitizer::getInstance();
                            $grouppermHandler = \xoops_getHandler('groupperm');
                            $ret = null;
                    Severity: Minor
                    Found in class/Plugins/legacy/Wfdownloads_podcast.php - About 1 hr to fix

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

                          public function grabEntries(\XoopsMySQLDatabase $xoopsDB):?array
                          {
                              $myts = \MyTextSanitizer::getInstance();
                              $ret  = null;
                      
                      
                      Severity: Minor
                      Found in class/Plugins/legacy/Queries.php - About 1 hr to fix

                        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 modifyObjects has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                        Open

                            public function modifyObjects(?\Criteria $criteria = null, array $fields = [], bool $force = false): ?string
                            {
                                if (\count($fields) > 0) {
                                    $obj = new $this->objClass();
                                    $sql = '';
                        Severity: Minor
                        Found in class/MiscHandler.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 modifyObjects has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                        Open

                            public function modifyObjects($criteria = null, array $fields = [], bool $force = false): ?string
                            {
                                if (\count($fields) > 0) {
                                    $object = new $this->objClass();
                                    $sql    = '';
                        Severity: Minor
                        Found in class/PluginHandler.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 xoops_module_install_rssfit has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        function xoops_module_install_rssfit(\XoopsModule $module): bool
                        {
                            require_once \dirname(__DIR__) . '/preloads/autoloader.php';
                            require_once \dirname(__DIR__, 3) . '/mainfile.php';
                        
                        
                        Severity: Minor
                        Found in include/oninstall.php - About 1 hr to fix

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

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

                            Method grabEntries has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                public function grabEntries(\XoopsMySQLDatabase $xoopsDB): ?array
                                {
                                    $myts = \MyTextSanitizer::getInstance();
                                    $ret  = null;
                                    require XOOPS_ROOT_PATH . '/include/comment_constants.php';
                            Severity: Minor
                            Found in class/Plugins/Comments.php - About 1 hr to fix
                              Severity
                              Category
                              Status
                              Source
                              Language