mambax7/myconference

View on GitHub

Showing 32 of 478 total issues

Function xoops_module_update_myconference has a Cognitive Complexity of 53 (exceeds 5 allowed). Consider refactoring.
Open

function xoops_module_update_myconference(\XoopsModule $module, $previousVersion = null)
{
    $moduleDirName = basename(dirname(__DIR__));
    $capsDirName   = strtoupper($moduleDirName);

Severity: Minor
Found in include/onupdate.php - About 1 day 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 deleteDirectory has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

    public static function deleteDirectory($src)
    {
        // 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 3 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 getFile has 61 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function getFile($file)
{
    require_once XOOPS_ROOT_PATH . '/class/uploader.php';
    $mimetypes = [
        'image/gif',
Severity: Major
Found in admin/conference.php - About 2 hrs to fix

    Method xoops_module_update_myconference has 56 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function xoops_module_update_myconference(\XoopsModule $module, $previousVersion = null)
    {
        $moduleDirName = basename(dirname(__DIR__));
        $capsDirName   = strtoupper($moduleDirName);
    
    
    Severity: Major
    Found in include/onupdate.php - About 2 hrs to fix

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

          public function render()
          {
              $ret = '';
              //
              if (!$this->caseSensitive) {
      Severity: Minor
      Found in class/Common/choicebyletter.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 getConfig has 48 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function getConfig()
      {
          $moduleDirName      = basename(dirname(__DIR__));
          $moduleDirNameUpper = strtoupper($moduleDirName);
          return (object)[
      Severity: Minor
      Found in include/config.php - About 1 hr to fix

        Method render has 45 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function render()
            {
                $ret = '';
                //
                if (!$this->caseSensitive) {
        Severity: Minor
        Found in class/Common/choicebyletter.php - About 1 hr to fix

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

              public static function createThumbs($filename)
              {/*
              require_once('phpthumb/phpthumb.class.php');
              $thumbnail_widths = array(150, 400);
              foreach ($thumbnail_widths as $thumbnail_width) {
          Severity: Minor
          Found in class/Utility.php - About 1 hr to fix

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

                public static function createThumbs($filename)
                {/*
                require_once('phpthumb/phpthumb.class.php');
                $thumbnail_widths = array(150, 400);
                foreach ($thumbnail_widths as $thumbnail_width) {
            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 imageSave has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
            Open

            function imageSave()
            {
                // Function that takes the data from the form and, in case of a
                // new image, uploads the file to the appropriate directory and
                // creates the record in the database; if it is an edit, the
            Severity: Minor
            Found in admin/images.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 makeMySelBox has 36 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function makeMySelBox($title, $order = '', $preset_id = 0, $none = 0, $sel_name = '', $onchange = '')
                {
                    if ('' == $sel_name) {
                        $sel_name = $this->id;
                    }
            Severity: Minor
            Found in class/Common/xoopstree.php - About 1 hr to fix

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

                  public static function recurseCopy($src, $dst)
                  {
                      $dir = opendir($src);
                      //        @mkdir($dst);
                      if (!mkdir($dst) && !is_dir($dst)) {
              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 makeMySelBox has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function makeMySelBox($title, $order = '', $preset_id = 0, $none = 0, $sel_name = '', $onchange = '')
                  {
                      if ('' == $sel_name) {
                          $sel_name = $this->id;
                      }
              Severity: Minor
              Found in class/Common/xoopstree.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_myconference has 35 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function xoops_module_install_myconference(\XoopsModule $module)
              {
                  require_once  __DIR__ . '/../../../mainfile.php';
                  require_once  __DIR__ . '/../include/config.php';
              
              
              Severity: Minor
              Found in include/oninstall.php - About 1 hr to fix

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

                    public static function rrmdir($src)
                    {
                        // 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

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

                    public static function getServerStats()
                    {
                        //mb    $wfdownloads = WfdownloadsWfdownloads::getInstance();
                        $moduleDirName      = basename(dirname(dirname(__DIR__)));
                        $moduleDirNameUpper = strtoupper($moduleDirName);
                Severity: Minor
                Found in class/Common/ServerStats.php - About 1 hr to fix

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

                      public static function lettersChoice($myObject, $activeObject, $criteria, $name, $link, $link2 = null)
                      {
                          /*
                          $pedigree = PedigreePedigree::getInstance();
                          xoops_load('XoopsLocal');
                  Severity: Minor
                  Found in class/Utility.php - About 1 hr to fix

                    Function rmdirr has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                    Open

                    function rmdirr($dirname)
                    {
                        // Simple delete for a file
                        if (is_file($dirname)) {
                            return unlink($dirname);
                    Severity: Minor
                    Found in include/onuninstall.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 deleteDirectory has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public static function deleteDirectory($src)
                        {
                            // 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

                      Method __construct has 8 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                              $objHandler,
                              $criteria = null,
                              $field_name = null,
                              $alphabet = [],
                              $arg_name = 'letter',
                      Severity: Major
                      Found in class/Common/choicebyletter.php - About 1 hr to fix
                        Severity
                        Category
                        Status
                        Source
                        Language