XoopsModules25x/xoopstube

View on GitHub

Showing 188 of 2,792 total issues

Function fileChecks has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

    public static function fileChecks()
    {
        echo '<fieldset>';
        echo '<legend style="color: #990000; font-weight: bold;">' . \_AM_XOOPSTUBE_FILECHECKS . '</legend>';

Severity: Minor
Found in class/Utility.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 xtubeReturnSource has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

function xtubeReturnSource($returnsource)
{
    switch ($returnsource) {
        case 0:
            $returnsource = _AM_XOOPSTUBE_YOUTUBE;
Severity: Minor
Found in include/video.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 getTotalItems has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

    public static function getTotalItems($sel_id = 0, $get_child = 0, $return_sql = 0)
    {
        global $mytree, $_check_array;

        if ($sel_id > 0) {
Severity: Minor
Found in class/Utility.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 getBannerFromBannerId has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

    public static function getBannerFromBannerId($banner_id)
    {
        ###### Hack by www.stefanosilvestrini.com ######
        $db      = \XoopsDatabaseFactory::getDatabaseConnection();
        $bresult = $db->query('SELECT COUNT(*) FROM ' . $db->prefix('banner') . ' WHERE bid=' . $banner_id);
Severity: Minor
Found in class/Utility.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

Method createMetaKeywords has 55 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public static function createMetaKeywords($content)
    {
        $keywordscount = self::getModuleOption('metagen_maxwords');
        $keywordsorder = self::getModuleOption('metagen_order');

Severity: Major
Found in class/Utility.php - About 2 hrs to fix

    Method isBlockCloned has 54 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        function isBlockCloned($bid, $bside, $bweight, $bvisible, $bcachetime, $bmodule, $options = null)
        {
            xoops_loadLanguage('admin', 'system');
            xoops_loadLanguage('admin/blocksadmin', 'system');
            xoops_loadLanguage('admin/groups', 'system');
    Severity: Major
    Found in admin/blocksadmin.php - About 2 hrs to fix

      Method getRandomVideoForHorizontalBlock has 53 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function getRandomVideoForHorizontalBlock($options)
      {
          global $myts;
          $moduleDirName = \basename(\dirname(__DIR__));
          $block         = [];
      Severity: Major
      Found in blocks/xoopstube_top.php - About 2 hrs to fix

        File modinfo.php has 255 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        <?php
        
        /**
         * Module: XoopsTube
         *
        Severity: Minor
        Found in language/english/modinfo.php - About 2 hrs to fix

          File video.php has 254 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          <?php
          
          /**
           * Module: XoopsTube
           *
          Severity: Minor
          Found in include/video.php - About 2 hrs to fix

            Function updateCache has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
            Open

                public static function updateCache()
                {
                    global $xoopsModule;
                    $folder  = $xoopsModule->getVar('dirname');
                    $tpllist = [];
            Severity: Minor
            Found in class/Utility.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

            Method getRandomVideo has 52 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function getRandomVideo($options)
            {
                global $myts;
                $utility       = new Utility();
                $moduleDirName = \basename(\dirname(__DIR__));
            Severity: Major
            Found in blocks/xoopstube_top.php - About 2 hrs to fix

              Method sendEmailFromTpl has 51 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public static function sendEmailFromTpl($tplName, $recipients, $subject, $variables)
                  {
                      global $xoopsConfig;
                      require_once XOOPS_ROOT_PATH . '/class/xoopsmailer.php';
                      if (!\is_array($recipients)) {
              Severity: Major
              Found in class/Utility.php - About 2 hrs to fix

                Method xtubeReturnSource has 51 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function xtubeReturnSource($returnsource)
                {
                    switch ($returnsource) {
                        case 0:
                            $returnsource = _AM_XOOPSTUBE_YOUTUBE;
                Severity: Major
                Found in include/video.php - About 2 hrs to fix

                  Method getBannerFromBannerId has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public static function getBannerFromBannerId($banner_id)
                      {
                          ###### Hack by www.stefanosilvestrini.com ######
                          $db      = \XoopsDatabaseFactory::getDatabaseConnection();
                          $bresult = $db->query('SELECT COUNT(*) FROM ' . $db->prefix('banner') . ' WHERE bid=' . $banner_id);
                  Severity: Minor
                  Found in class/Utility.php - About 1 hr to fix

                    Method getBannerFromClientId has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public static function getBannerFromClientId($client_id)
                        {
                            ###### Hack by www.stefanosilvestrini.com ######
                            $db      = \XoopsDatabaseFactory::getDatabaseConnection();
                            $bresult = $db->query('SELECT COUNT(*) FROM ' . $db->prefix('banner') . ' WHERE cid=' . $client_id);
                    Severity: Minor
                    Found in class/Utility.php - About 1 hr to fix

                      Function sendEmailFromTpl has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public static function sendEmailFromTpl($tplName, $recipients, $subject, $variables)
                          {
                              global $xoopsConfig;
                              require_once XOOPS_ROOT_PATH . '/class/xoopsmailer.php';
                              if (!\is_array($recipients)) {
                      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 edit has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                      Open

                      function edit($lid = 0)
                      {
                          global $myts, $mytree, $xtubeImageArray;
                      
                          $sql = 'SELECT * FROM ' . $GLOBALS['xoopsDB']->prefix('xoopstube_videos') . ' WHERE lid=' . $lid;
                      Severity: Minor
                      Found in admin/main.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 getRandomVideo has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                      Open

                      function getRandomVideo($options)
                      {
                          global $myts;
                          $utility       = new Utility();
                          $moduleDirName = \basename(\dirname(__DIR__));
                      Severity: Minor
                      Found in blocks/xoopstube_top.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 getRandomVideoForHorizontalBlock has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                      Open

                      function getRandomVideoForHorizontalBlock($options)
                      {
                          global $myts;
                          $moduleDirName = \basename(\dirname(__DIR__));
                          $block         = [];
                      Severity: Minor
                      Found in blocks/xoopstube_top.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 fetchMedia has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public function fetchMedia($media_name, $index = null)
                          {
                              global $_FILES;
                      
                              if (!isset($_FILES[$media_name])) {
                      Severity: Minor
                      Found in class/MediaUploader.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

                      Severity
                      Category
                      Status
                      Source
                      Language