XoopsModules25x/xoopsinfo

View on GitHub

Showing 1,065 of 16,781 total issues

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

    private function _temperature()
    {
        foreach ($this->_buf as $sensor) {
            if (((isset($sensor['Sensor Type (Threshold)']) && ($sensor['Sensor Type (Threshold)'] == 'Temperature'))
                ||(isset($sensor['Sensor Type (Analog)']) && ($sensor['Sensor Type (Analog)'] == 'Temperature')))
Severity: Minor
Found in phpsysinfo/includes/mb/class.ipmitool.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 __construct has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    public function __construct()
    {
        parent::__construct();
        $_wmi = null;
        try {
Severity: Minor
Found in phpsysinfo/includes/mb/class.ohm.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 _kernel has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    private function _kernel()
    {
        if (CommonFunctions::executeProgram('uname', '-r', $strBuf, false)) {
            $result = $strBuf;
            if (CommonFunctions::executeProgram('uname', '-v', $strBuf, PSI_DEBUG)) {
Severity: Minor
Found in phpsysinfo/includes/os/class.Android.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 _buildPlugins has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    private function _buildPlugins()
    {
        $pluginroot = $this->_xml->addChild("Plugins");
        if (($this->_plugin_request || $this->_complete_request) && count($this->_plugins) > 0) {
            $plugins = array();
Severity: Minor
Found in phpsysinfo/includes/xml/class.XML.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 _parse_log_file has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    private static function _parse_log_file($string)
    {
        global $log_file;
        if (file_exists($log_file)) {
            $contents = @file_get_contents($log_file);
Severity: Minor
Found in phpsysinfo/tools/checkdistro.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 html has 35 lines of code (exceeds 25 allowed). Consider refactoring.
Open

            html: function () {
                var processes = "", p111 = 0, p112 = 0, p113 = 0, p114 = 0, p115 = 0, p116 = 0;
                var not_first = false;
                processes = parseInt(this.Processes);
                if (this.ProcessesRunning !== undefined) {
Severity: Minor
Found in phpsysinfo/js/phpSysInfo/phpsysinfo_bootstrap.js - About 1 hr to fix

    Method _fans has 35 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        protected function _fans($hwpath)
        {
           $sensor = glob($hwpath."fan*_input", GLOB_NOSORT);
           if (is_array($sensor) && (($total = count($sensor)) > 0)) {
                $buf = "";
    Severity: Minor
    Found in phpsysinfo/includes/mb/class.hwmon.inc.php - About 1 hr to fix

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

          private function _cpuinfo()
          {
              $ncpu = 0;
              $tcpu = "";
              $vcpu = "";
      Severity: Minor
      Found in phpsysinfo/includes/os/class.AIX.inc.php - About 1 hr to fix

        Method upload has 35 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            function upload($chmod = 0644) {
                if ($this->uploadDir == '') {
                    $this->setErrors( _ER_UP_UPLOADDIRNOTSET );
                    return false;
                }
        Severity: Minor
        Found in class/uploader.php - About 1 hr to fix

          Method getUnixId has 35 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function getUnixId()
              {
                  if ($this->osIsWindows()) {
                      return false;
                  }
          Severity: Minor
          Found in phpsecinfo/PhpSecInfo/Test/Test.php - About 1 hr to fix

            Function adjustCSS has 34 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function adjustCSS( elem, prop, valueParts, tween ) {
                var adjusted,
                    scale = 1,
                    maxIterations = 20,
                    currentValue = tween ?
            Severity: Minor
            Found in phpsysinfo/js/jQuery/jquery.js - About 1 hr to fix

              Function getLanguage has 34 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function getLanguage(plugin, langarrId) {
                  var getLangUrl = "";
                  if (current_language) {
                      getLangUrl = 'language/language.php?lang=' + current_language;
                      if (plugin) {
              Severity: Minor
              Found in phpsysinfo/js/phpSysInfo/phpsysinfo.js - About 1 hr to fix

                Function aTypes has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        function ( sData )
                        {
                            /* Allow zero length strings as a number */
                            if ( typeof sData == 'number' )
                            {
                Severity: Minor
                Found in phpsysinfo/js/jQuery/jquery.dataTables.js - About 1 hr to fix

                  Function load has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  jQuery.fn.load = function( url, params, callback ) {
                      if ( typeof url !== "string" && _load ) {
                          return _load.apply( this, arguments );
                      }
                  
                  
                  Severity: Minor
                  Found in phpsysinfo/js/jQuery/jquery.js - About 1 hr to fix

                    Function setOffset has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        setOffset: function( elem, options, i ) {
                            var curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition,
                                position = jQuery.css( elem, "position" ),
                                curElem = jQuery( elem ),
                                props = {};
                    Severity: Minor
                    Found in phpsysinfo/js/jQuery/jquery.js - About 1 hr to fix

                      Function fnAddData has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                              this.fnAddData = function( mData, bRedraw )
                              {
                                  if ( mData.length === 0 )
                                  {
                                      return [];
                      Severity: Minor
                      Found in phpsysinfo/js/jQuery/jquery.dataTables.js - About 1 hr to fix

                        Method _kernel has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            private function _kernel()
                            {
                                $result = "";
                                if (CommonFunctions::executeProgram($uname="uptrack-uname", '-r', $strBuf, false) || // show effective kernel if ksplice uptrack is installed
                                    CommonFunctions::executeProgram($uname="uname", '-r', $strBuf, PSI_DEBUG)) {
                        Severity: Minor
                        Found in phpsysinfo/includes/os/class.Linux.inc.php - About 1 hr to fix

                          Method _uptime has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              private function _uptime()
                              {
                                  $result = 0;
                                  date_default_timezone_set('UTC');
                                  $buffer = $this->_get_Win32_OperatingSystem();
                          Severity: Minor
                          Found in phpsysinfo/includes/os/class.WINNT.inc.php - About 1 hr to fix

                            Method getWMI has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                public static function getWMI($wmi, $strClass, $strValue = array())
                                {
                                    $arrData = array();
                                    if (gettype($wmi) === "object") {
                                        $value = "";
                            Severity: Minor
                            Found in phpsysinfo/includes/class.CommonFunctions.inc.php - About 1 hr to fix

                              Method edit_mimetypes has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              function edit_mimetypes()
                              {
                                  global $status, $mid, $start;
                              
                                  $mime_id = isset($_REQUEST['mime_id']) ? (int)$_REQUEST['mime_id'] : 0;
                              Severity: Minor
                              Found in modules/xoopsinfo/include/mimetypes.php - About 1 hr to fix
                                Severity
                                Category
                                Status
                                Source
                                Language