XoopsModules25x/xoopsinfo

View on GitHub

Showing 1,065 of 16,781 total issues

Function execute_mdstat has a Cognitive Complexity of 160 (exceeds 5 allowed). Consider refactoring.
Open

    private function execute_mdstat($buffer)
    {
        $raiddata = preg_split("/\r?\n/", $buffer, -1, PREG_SPLIT_NO_EMPTY);
        if (!empty($raiddata)) {
            // get the supported types
Severity: Minor
Found in phpsysinfo/plugins/raid/class.raid.inc.php - About 3 days 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_raid has a Cognitive Complexity of 158 (exceeds 5 allowed). Consider refactoring.
Open

function renderPlugin_raid(data) {

    function raid_buildaction(data) {
        var html = "", name = "", percent = 0;
        if (data !== undefined) {
Severity: Minor
Found in phpsysinfo/plugins/raid/js/raid_bootstrap.js - About 3 days 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 _buildMbinfo has a Cognitive Complexity of 152 (exceeds 5 allowed). Consider refactoring.
Open

    private function _buildMbinfo()
    {
        $mbinfo = $this->_xml->addChild('MBInfo');
        $temp = $fan = $volt = $power = $current = $other = null;

Severity: Minor
Found in phpsysinfo/includes/xml/class.XML.inc.php - About 3 days 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 prtconf has a Cognitive Complexity of 150 (exceeds 5 allowed). Consider refactoring.
Open

    protected function prtconf()
    {
        if ($this->_prtconf === null) {
            $this->_prtconf = array();
            if (CommonFunctions::executeProgram('prtconf', '-v', $buf, PSI_DEBUG) && ($buf!="")) {
Severity: Minor
Found in phpsysinfo/includes/os/class.SunOS.inc.php - About 3 days 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 execute_megactl has a Cognitive Complexity of 128 (exceeds 5 allowed). Consider refactoring.
Open

    private function execute_megactl($buffer, $sas = false)
    {
        $raiddata = preg_split("/(\r?\n)+(?=[a-z]\d+ )/", $buffer, -1, PREG_SPLIT_NO_EMPTY);
        if (!empty($raiddata)) foreach ($raiddata as $raidgroup) {
            if (preg_match("/^([a-z]\d+) /", $raidgroup, $buff)) {
Severity: Minor
Found in phpsysinfo/plugins/raid/class.raid.inc.php - About 2 days 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 xml has a Cognitive Complexity of 111 (exceeds 5 allowed). Consider refactoring.
Open

    public function xml()
    {
        if (empty($this->_result)) {
            return $this->xml->getSimpleXmlElement();
        }
Severity: Minor
Found in phpsysinfo/plugins/raid/class.raid.inc.php - About 2 days 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 108 (exceeds 5 allowed). Consider refactoring.
Open

    public function __construct($enc)
    {
        parent::__construct(__CLASS__, $enc);
        switch (strtolower(PSI_PLUGIN_PS_ACCESS)) {
        case 'command':
Severity: Minor
Found in phpsysinfo/plugins/ps/class.ps.inc.php - About 2 days 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 _buildHardware has a Cognitive Complexity of 107 (exceeds 5 allowed). Consider refactoring.
Open

    private function _buildHardware()
    {
        $hardware = $this->_xml->addChild('Hardware');
        if ($this->_sys->getMachine() != "") {
            $hardware->addAttribute('Name', $this->_sys->getMachine());
Severity: Minor
Found in phpsysinfo/includes/xml/class.XML.inc.php - About 2 days 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 _usb has a Cognitive Complexity of 106 (exceeds 5 allowed). Consider refactoring.
Open

    protected function _usb()
    {
        $usbarray = array();
        if (CommonFunctions::executeProgram('lsusb', (PSI_OS != 'Android')?'':'2>/dev/null', $bufr, PSI_DEBUG && (PSI_OS != 'Android'), 5) && ($bufr !== "")) {
            $bufe = preg_split("/\n/", $bufr, -1, PREG_SPLIT_NO_EMPTY);
Severity: Minor
Found in phpsysinfo/includes/os/class.Linux.inc.php - About 2 days 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 105 (exceeds 5 allowed). Consider refactoring.
Open

    public function __construct($enc)
    {
        parent::__construct(__CLASS__, $enc);
        switch (strtolower(PSI_PLUGIN_SNMPPINFO_ACCESS)) {
        case 'command':
Severity: Minor
Found in phpsysinfo/plugins/snmppinfo/class.snmppinfo.inc.php - About 2 days 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 execute_graid has a Cognitive Complexity of 104 (exceeds 5 allowed). Consider refactoring.
Open

    private function execute_graid($buffer)
    {
        if (preg_match('/^Geom name: +([^\n\r]+)/', $buffer, $geom)) {
            $controller = trim($geom[1]);
        } else {
Severity: Minor
Found in phpsysinfo/plugins/raid/class.raid.inc.php - About 2 days 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 95 (exceeds 5 allowed). Consider refactoring.
Open

    public function __construct($enc)
    {
        parent::__construct(__CLASS__, $enc);

        $RaidProgs = array();
Severity: Minor
Found in phpsysinfo/plugins/raid/class.raid.inc.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

Method execute_idrac has 373 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    private function execute_idrac($buffer, $device)
    {
        $snmptablec = array(); //controller table
        $snmptableb = array(); //battery table
        $snmptablev = array(); //virtual disks table
Severity: Major
Found in phpsysinfo/plugins/raid/class.raid.inc.php - About 1 day to fix

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

        private function _temperature()
        {
            if (PSI_OS == 'WINNT') {
                if ($this->_buf) foreach ($this->_buf as $buffer) {
                    if (isset($buffer['CurrentTemperature']) && (($value = ($buffer['CurrentTemperature'] - 2732)/10) > -100)) {
    Severity: Minor
    Found in phpsysinfo/includes/mb/class.thermalzone.inc.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 __construct has a Cognitive Complexity of 89 (exceeds 5 allowed). Consider refactoring.
    Open

        public function __construct()
        {
            parent::__construct();
            switch (strtolower(PSI_UPS_SNMPUPS_ACCESS)) {
            case 'command':
    Severity: Minor
    Found in phpsysinfo/includes/ups/class.snmpups.inc.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 Modal has 349 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      function () {
        function Modal(element, config) {
          this._config = this._getConfig(config);
          this._element = element;
          this._dialog = element.querySelector(Selector.DIALOG);
    Severity: Major
    Found in phpsysinfo/js/vendor/bootstrap-modal.js - About 1 day to fix

      File class.WINNT.inc.php has 739 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      <?php
      /**
       * WINNT System Class
       *
       * PHP version 5
      Severity: Major
      Found in phpsysinfo/includes/os/class.WINNT.inc.php - About 1 day to fix

        Function _network has a Cognitive Complexity of 83 (exceeds 5 allowed). Consider refactoring.
        Open

            private function _network()
            {
                if (CommonFunctions::executeProgram('netstat', '-ni | awk \'(NF ==10){print;}\'', $netstat, PSI_DEBUG)) {
                    $lines = preg_split("/\n/", $netstat, -1, PREG_SPLIT_NO_EMPTY);
                    foreach ($lines as $line) {
        Severity: Minor
        Found in phpsysinfo/includes/os/class.SunOS.inc.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

        File class.bat.inc.php has 710 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        <?php
        /**
         * BAT Plugin, which displays battery state
         *
         * @category  PHP
        Severity: Major
        Found in phpsysinfo/plugins/bat/class.bat.inc.php - About 1 day to fix

          Function __construct has a Cognitive Complexity of 81 (exceeds 5 allowed). Consider refactoring.
          Open

              public function __construct()
              {
                  parent::__construct();
                  $lines = "";
                  switch (defined('PSI_SENSOR_IPMITOOL_ACCESS')?strtolower(PSI_SENSOR_IPMITOOL_ACCESS):'command') {
          Severity: Minor
          Found in phpsysinfo/includes/mb/class.ipmitool.inc.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

          Severity
          Category
          Status
          Source
          Language