XoopsModules25x/xoopsinfo

View on GitHub

Showing 1,065 of 16,781 total issues

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

    protected function distro()
    {
        $this->sys->setDistributionIcon('Darwin.png');
        if (!CommonFunctions::executeProgram('system_profiler', 'SPSoftwareDataType', $buffer, PSI_DEBUG)) {
            parent::distro();
Severity: Minor
Found in phpsysinfo/includes/os/class.Darwin.inc.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 _trace has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

    private function _trace($strMessage)
    {
        $arrTrace = array_reverse(debug_backtrace());
        $strFunc = '';
        $strBacktrace = htmlspecialchars($strMessage)."\n\n";
Severity: Minor
Found in phpsysinfo/includes/error/class.PSI_Error.inc.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 getDocker has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

    private function getDocker()
    {
        $result = array();
        $i = 0;

Severity: Minor
Found in phpsysinfo/plugins/docker/class.docker.inc.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 full_addr has 56 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function full_addr(ip_string) {
    var wrongvalue = false;
    ip_string = $.trim(ip_string).toLowerCase();
    // ipv4 notation
    if (ip_string.match(/^([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$)/)) {
Severity: Major
Found in phpsysinfo/js/phpSysInfo/phpsysinfo_bootstrap.js - About 2 hrs to fix

    Function full_addr has 56 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function full_addr(ip_string) {
        var wrongvalue = false;
        ip_string = $.trim(ip_string).toLowerCase();
        // ipv4 notation
        if (ip_string.match(/^([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$)/)) {
    Severity: Major
    Found in phpsysinfo/js/phpSysInfo/phpsysinfo.js - About 2 hrs to fix

      Function _fnLoadState has 56 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              function _fnLoadState ( oSettings, oInit )
              {
                  if ( !oSettings.oFeatures.bStateSave )
                  {
                      return;
      Severity: Major
      Found in phpsysinfo/js/jQuery/jquery.dataTables.js - About 2 hrs to fix

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

            private function getDocker()
            {
                $result = array();
                $i = 0;
        
        
        Severity: Major
        Found in phpsysinfo/plugins/docker/class.docker.inc.php - About 2 hrs to fix

          File mimetypes.php has 257 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          <?php
          
          declare(strict_types=1);
          
          /**
          Severity: Minor
          Found in modules/xoopsinfo/admin/mimetypes.php - About 2 hrs to fix

            XoopsMediaUploader has 21 functions (exceeds 20 allowed). Consider refactoring.
            Open

            class XoopsMediaUploader {
                /**
                * Flag indicating if unrecognized mimetypes should be allowed (use with precaution ! may lead to security issues )
                **/
                var $allowUnknownTypes = false;
            Severity: Minor
            Found in class/uploader.php - About 2 hrs to fix

              Function remove has 54 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  remove: function( elem, types, handler, selector, mappedTypes ) {
                      var j, handleObj, tmp,
                          origCount, t, events,
                          special, handlers, type,
                          namespaces, origType,
              Severity: Major
              Found in phpsysinfo/js/jQuery/jquery.js - About 2 hrs to fix

                Function fnUpdate has 54 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        this.fnUpdate = function( mData, mRow, iColumn, bRedraw, bAction )
                        {
                            var oSettings = _fnSettingsFromNode( this[_oExt.iApiIndex] );
                            var iVisibleColumn, i, iLen, sDisplay;
                            var iRow = (typeof mRow == 'object') ? 
                Severity: Major
                Found in phpsysinfo/js/jQuery/jquery.dataTables.js - About 2 hrs to fix

                  Function fnInit has 54 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                              "fnInit": function ( oSettings, nPaging, fnCallbackDraw )
                              {
                                  var nFirst = document.createElement( 'span' );
                                  var nPrevious = document.createElement( 'span' );
                                  var nList = document.createElement( 'span' );
                  Severity: Major
                  Found in phpsysinfo/js/jQuery/jquery.dataTables.js - About 2 hrs to fix

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

                        private function _devicelist($strType)
                        {
                            if (empty($this->_wmidevices)) {
                                if (defined('PSI_SHOW_DEVICES_INFOS') && PSI_SHOW_DEVICES_INFOS) {
                                    $this->_wmidevices = CommonFunctions::getWMI($this->_wmi, 'Win32_PnPEntity', array('Name', 'PNPDeviceID', 'Manufacturer', 'PNPClass'));
                    Severity: Major
                    Found in phpsysinfo/includes/os/class.WINNT.inc.php - About 2 hrs to fix

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

                          protected function _cpuinfo()
                          {
                              if (CommonFunctions::rfts('/proc/cpuinfo', $bufr, 0, 4096, false)) {
                                  $processors = preg_split('/\s?\n\s?\n/', trim($bufr));
                                  foreach ($processors as $processor) {
                      Severity: Major
                      Found in phpsysinfo/includes/os/class.Minix.inc.php - About 2 hrs to fix

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

                            public static function rfts($strFileName, &$strRet, $intLines = 0, $intBytes = 4096, $booErrorRep = true)
                            {
                                if (defined('PSI_LOG') && is_string(PSI_LOG) && (strlen(PSI_LOG)>0) && ((substr(PSI_LOG, 0, 1)=="-") || (substr(PSI_LOG, 0, 1)=="+"))) {
                                    $out = self::_parse_log_file("Reading: ".$strFileName);
                                    if ($out == false) {
                        Severity: Major
                        Found in phpsysinfo/includes/class.CommonFunctions.inc.php - About 2 hrs to fix

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

                              function insert(&$mimetype_object, $force = false) {
                                  if (strtolower(get_class($mimetype_object)) != 'xoopsmimetypes_perms') {
                                      return false;
                                  }
                                  if (!$mimetype_object->isDirty()) {
                          Severity: Major
                          Found in kernel/mimetypes.php - About 2 hrs to fix

                            File read_config.php has 256 lines of code (exceeds 250 allowed). Consider refactoring.
                            Open

                            <?php
                            if (!defined('PSI_CONFIG_FILE')) {
                                /**
                                 * phpSysInfo version
                                 */
                            Severity: Minor
                            Found in phpsysinfo/read_config.php - About 2 hrs to fix

                              Function _fnColumnOptions has 53 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                      function _fnColumnOptions( oSettings, iCol, oOptions )
                                      {
                                          var oCol = oSettings.aoColumns[ iCol ];
                                          
                                          /* User specified column options */
                              Severity: Major
                              Found in phpsysinfo/js/jQuery/jquery.dataTables.js - About 2 hrs to fix

                                Function _showBackdrop has 53 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    _proto._showBackdrop = function _showBackdrop(callback) {
                                      var _this8 = this;
                                
                                      var animate = $(this._element).hasClass(ClassName.FADE) ? ClassName.FADE : '';
                                
                                
                                Severity: Major
                                Found in phpsysinfo/js/vendor/bootstrap-modal.js - About 2 hrs to fix

                                  Function fileType has 53 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      function fileType() {
                                          var from = currentSettings.from;
                                  
                                          var url;
                                  
                                  
                                  Severity: Major
                                  Found in phpsysinfo/js/jQuery/jquery.nyroModal.js - About 2 hrs to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language