XoopsModules25x/xoopsinfo

View on GitHub

Showing 1,065 of 16,781 total issues

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

    private function _usb()
    {
        if (CommonFunctions::rfts('/proc/bus/usb/devices', $bufr, 0, 4096, false)) {
            $bufe = preg_split("/\n/", $bufr, -1, PREG_SPLIT_NO_EMPTY);
            $devnum = -1;
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 _memory has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    private function _memory()
    {
        if (CommonFunctions::rfts('/proc/meminfo', $bufr)) {
            $bufe = preg_split("/\n/", $bufr, -1, PREG_SPLIT_NO_EMPTY);
            foreach ($bufe as $buf) {
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 13 (exceeds 5 allowed). Consider refactoring.
Open

    protected function pci()
    {
        if (!$arrResults = Parser::lspci(false)) { //no lspci port
            $s = $this->_grabioreg('IOPCIDevice');
            $lines = preg_split("/\n/", $s, -1, PREG_SPLIT_NO_EMPTY);
Severity: Minor
Found in phpsysinfo/includes/os/class.Darwin.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 fileexists has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    public static function fileexists($strFileName)
    {
        if (defined('PSI_LOG') && is_string(PSI_LOG) && (strlen(PSI_LOG)>0) && ((substr(PSI_LOG, 0, 1)=="-") || (substr(PSI_LOG, 0, 1)=="+"))) {
            $log_file = substr(PSI_LOG, 1);
            if (file_exists($log_file)
Severity: Minor
Found in phpsysinfo/includes/class.CommonFunctions.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 13 (exceeds 5 allowed). Consider refactoring.
Open

    public function __construct()
    {
        parent::__construct();
        if (defined('PSI_UPS_APCUPSD_LIST') && is_string(PSI_UPS_APCUPSD_LIST)) {
            if (preg_match(ARRAY_EXP, PSI_UPS_APCUPSD_LIST)) {
Severity: Minor
Found in phpsysinfo/includes/ups/class.apcupsd.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 13 (exceeds 5 allowed). Consider refactoring.
Open

    protected function _pci()
    {
        if (CommonFunctions::rfts('/proc/pci', $strBuf, 0, 4096, false)) {
            $arrLines = preg_split("/\n/", $strBuf, -1, PREG_SPLIT_NO_EMPTY);
            $arrResults = array();
Severity: Minor
Found in phpsysinfo/includes/os/class.Minix.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 xml has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    public function xml()
    {
        if (empty($this->_result) || empty($this->_ids)) {
            return $this->xml->getSimpleXmlElement();
        }
Severity: Minor
Found in phpsysinfo/plugins/smart/class.smart.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 execute has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    public function execute()
    {
        if (empty($this->_filecontent)) {
            return;
        }
Severity: Minor
Found in phpsysinfo/plugins/updatenotifier/class.updatenotifier.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 access has 39 lines of code (exceeds 25 allowed). Consider refactoring.
Open

var access = function( elems, fn, key, value, chainable, emptyGet, raw ) {
    var i = 0,
        length = elems.length,
        bulk = key == null;

Severity: Minor
Found in phpsysinfo/js/jQuery/jquery.js - About 1 hr to fix

    Method _scsi has 39 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        private function _scsi()
        {
            $getline = 0;
            $device = null;
            $scsiid = null;
    Severity: Minor
    Found in phpsysinfo/includes/os/class.Linux.inc.php - About 1 hr to fix

      Method _memory has 39 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          private function _memory()
          {
              $mems = "";
              $tswap = "";
              $pswap = "";
      Severity: Minor
      Found in phpsysinfo/includes/os/class.AIX.inc.php - About 1 hr to fix

        Function renderFans has 38 lines of code (exceeds 25 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

          Function renderPower has 38 lines of code (exceeds 25 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

            Function renderTemperature has 38 lines of code (exceeds 25 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

              Function _fnFeatureHtmlFilter has 38 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      function _fnFeatureHtmlFilter ( oSettings )
                      {
                          var sSearchStr = oSettings.oLanguage.sSearch;
                          sSearchStr = (sSearchStr.indexOf('_INPUT_') !== -1) ?
                            sSearchStr.replace('_INPUT_', '<input type="text" />') :
              Severity: Minor
              Found in phpsysinfo/js/jQuery/jquery.dataTables.js - About 1 hr to fix

                Function nyroModal has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    $.fn.nyroModal = function(settings) {
                        if (!this)
                            return false;
                        return this.each(function() {
                            var me = $(this);
                Severity: Minor
                Found in phpsysinfo/js/jQuery/jquery.nyroModal.js - About 1 hr to fix

                  Method _power has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      private function _power()
                      {
                          $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

                    Function fillHWDevice has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    function fillHWDevice(xml, type, tree, rootposition) {
                        var devicecount = 0, html = "";
                        $("Hardware " + type + " Device", xml).each(function getHWDevice(deviceId) {
                            var name = "", count = 0, capacity = 0, manufacturer = "", product = "", serial = "", devcoreposition = 0;
                    
                    
                    Severity: Minor
                    Found in phpsysinfo/js/phpSysInfo/phpsysinfo.js - About 1 hr to fix

                      Function getLanguage has 37 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_bootstrap.js - About 1 hr to fix

                        Function when has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            when: function( subordinate /* , ..., subordinateN */ ) {
                                var i = 0,
                                    resolveValues = slice.call( arguments ),
                                    length = resolveValues.length,
                        
                        
                        Severity: Minor
                        Found in phpsysinfo/js/jQuery/jquery.js - About 1 hr to fix
                          Severity
                          Category
                          Status
                          Source
                          Language