XoopsModules25x/xoopsinfo

View on GitHub

Showing 1,065 of 16,781 total issues

Method _other has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    private function _other()
    {
        $sname = '';
        foreach ($this->_lines as $line) {
            if ((trim($line) !== "") && (strpos($line, ':') === false)) {
Severity: Minor
Found in phpsysinfo/includes/mb/class.lmsensors.inc.php - About 1 hr to fix

    Method build has 28 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function build()
        {
            if (!$this->blockname || $this->blockname==='vitals') {
                $this->_distro();
                $this->_hostname();
    Severity: Minor
    Found in phpsysinfo/includes/os/class.Linux.inc.php - About 1 hr to fix

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

          private function _cpuinfo()
          {
              if (CommonFunctions::executeProgram('kstat', '-p d cpu_info:*:cpu_info*:core_id', $m, PSI_DEBUG) && ($m!=="")) {
                  $cpuc = count(preg_split('/\n/', $m, -1, PREG_SPLIT_NO_EMPTY));
                  for ($cpu=0; $cpu < $cpuc; $cpu++) {
      Severity: Minor
      Found in phpsysinfo/includes/os/class.SunOS.inc.php - About 1 hr to fix

        Method getUprecords has 28 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            private function getUprecords()
            {
                $result = array();
                $i = 0;
        
        
        Severity: Minor
        Found in phpsysinfo/plugins/uprecords/class.uprecords.inc.php - About 1 hr to fix

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

          function renderFans(data) {
              if ((blocks.length <= 0) || ((blocks[0] !== "true") && ($.inArray('fans', blocks) < 0))) {
                  $("#block_fans").remove();
                  return;
              }
          Severity: Minor
          Found in phpsysinfo/js/phpSysInfo/phpsysinfo_bootstrap.js - 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 genlang has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
          Open

          function genlang(id, plugin) {
              var html = "", idString = "", plugname = "",
                  langarrId = current_language + "_";
          
              if (plugin === undefined) {
          Severity: Minor
          Found in phpsysinfo/js/phpSysInfo/phpsysinfo_bootstrap.js - 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 renderPower has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
          Open

          function renderPower(data) {
              if ((blocks.length <= 0) || ((blocks[0] !== "true") && ($.inArray('power', blocks) < 0))) {
                  $("#block_power").remove();
                  return;
              }
          Severity: Minor
          Found in phpsysinfo/js/phpSysInfo/phpsysinfo_bootstrap.js - 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 renderTemperature has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
          Open

          function renderTemperature(data) {
              if ((blocks.length <= 0) || ((blocks[0] !== "true") && ($.inArray('temperature', blocks) < 0))) {
                  $("#block_temperature").remove();
                  return;
              }
          Severity: Minor
          Found in phpsysinfo/js/phpSysInfo/phpsysinfo_bootstrap.js - 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 genlang has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
          Open

          function genlang(id, plugin) {
              var html = "", idString = "", plugname = "",
                  langarrId = current_language + "_";
          
              if (plugin === undefined) {
          Severity: Minor
          Found in phpsysinfo/js/phpSysInfo/phpsysinfo.js - 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 renderPlugin_uprecords has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
          Open

          function renderPlugin_uprecords(data) {
          
              var directives = {
                  hash: {
                      html: function () {
          Severity: Minor
          Found in phpsysinfo/plugins/uprecords/js/uprecords_bootstrap.js - 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 _power has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
          Open

              private function _power()
              {
                  foreach ($this->_lines as $line) {
                      $buffer = preg_split("/\s*\|\s*/", $line);
                      if ($buffer[2] == "Current" && $buffer[11] != "N/A" && $buffer[4] == "W") {
          Severity: Minor
          Found in phpsysinfo/includes/mb/class.freeipmi.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 _temperature has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
          Open

              private function _temperature()
              {
                  foreach ($this->_lines as $line) {
                      if (preg_match('/^(TEMP\d*)\s*:\s*(.*)$/D', $line, $data)) {
                          if ($data[2] <> '0') {
          Severity: Minor
          Found in phpsysinfo/includes/mb/class.mbmon.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 getMemPercentCache has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
          Open

              public function getMemPercentCache()
              {
                  if ($this->_memCache !== null) {
                      if (($this->_memCache > 0) && ($this->_memTotal > 0)) {
                          if (($this->_memApplication !== null) && ($this->_memApplication > 0)) {
          Severity: Minor
          Found in phpsysinfo/includes/to/class.System.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 _temperature has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
          Open

              private function _temperature()
              {
                  if (CommonFunctions::executeProgram("snmpwalk", "-Ona -c public -v 1 -t ".PSI_SNMP_TIMEOUT_INT." -r ".PSI_SNMP_RETRY_INT." 127.0.0.1 .1.3.6.1.4.1.24681.1.2.5.0", $buffer, PSI_DEBUG)
                     && preg_match('/^[\.\d]+ = STRING:\s\"?(\d+)\sC/', $buffer, $data)) {
                      $dev = new SensorDevice();
          Severity: Minor
          Found in phpsysinfo/includes/mb/class.qtssnmp.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 10 (exceeds 5 allowed). Consider refactoring.
          Open

              public function __construct()
              {
                  parent::__construct();
                  switch (defined('PSI_SENSOR_MBMON_ACCESS')?strtolower(PSI_SENSOR_MBMON_ACCESS):'command') {
                  case 'tcp':
          Severity: Minor
          Found in phpsysinfo/includes/mb/class.mbmon.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 _temperature has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
          Open

              private function _temperature()
              {
                  foreach ($this->_lines as $line) {
                      if (preg_match('/(.*):\s*(\d*)/', $line, $data)) {
                          if ($data[2] > 0) {
          Severity: Minor
          Found in phpsysinfo/includes/mb/class.k8temp.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 10 (exceeds 5 allowed). Consider refactoring.
          Open

              public function __construct()
              {
                  parent::__construct();
                  switch (defined('PSI_SENSOR_HEALTHD_ACCESS')?strtolower(PSI_SENSOR_HEALTHD_ACCESS):'command') {
                  case 'command':
          Severity: Minor
          Found in phpsysinfo/includes/mb/class.healthd.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 _scsi has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
          Open

              private function _scsi()
              {
                  $get_type = false;
                  if (CommonFunctions::rfts('/proc/scsi/scsi', $bufr, 0, 4096, PSI_DEBUG)) {
                      $bufe = preg_split("/\n/", $bufr, -1, PREG_SPLIT_NO_EMPTY);
          Severity: Minor
          Found in phpsysinfo/includes/os/class.HPUX.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 _pci has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
          Open

              private function _pci()
              {
                  if (CommonFunctions::rfts('/proc/pci', $bufr)) {
                      $device = false;
                      $bufe = preg_split("/\n/", $bufr, -1, PREG_SPLIT_NO_EMPTY);
          Severity: Minor
          Found in phpsysinfo/includes/os/class.HPUX.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 _temperature has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
          Open

              private function _temperature()
              {
                  foreach ($this->_lines as $line) {
                      $buffer = preg_split("/\s*\|\s*/", $line);
                      if ($buffer[2] == "Temperature" && $buffer[11] != "N/A" && $buffer[4] == "C") {
          Severity: Minor
          Found in phpsysinfo/includes/mb/class.freeipmi.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

          Severity
          Category
          Status
          Source
          Language