XoopsModules25x/xoopsinfo

View on GitHub

Showing 1,065 of 16,781 total issues

Function _prepare has a Cognitive Complexity of 51 (exceeds 5 allowed). Consider refactoring.
Open

    private function _prepare()
    {
        if ($this->_pluginName === null) {
            // Figure out which OS we are running on, and detect support
            if (!file_exists(PSI_APP_ROOT.'/includes/os/class.'.PSI_OS.'.inc.php')) {
Severity: Minor
Found in phpsysinfo/includes/output/class.WebpageXML.inc.php - About 7 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 renderPlugin_stablebit has a Cognitive Complexity of 49 (exceeds 5 allowed). Consider refactoring.
Open

function renderPlugin_stablebit(data) {

    var directives = {
        IsHot: {
            html: function () {
Severity: Minor
Found in phpsysinfo/plugins/stablebit/js/stablebit_bootstrap.js - About 7 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 _pci has a Cognitive Complexity of 49 (exceeds 5 allowed). Consider refactoring.
Open

    protected function _pci()
    {
        $prtconf = $this->prtconf();
        if ((count($prtconf)>1) && isset($prtconf['pci'])) {
            foreach ($prtconf['pci'] as $prt) {
Severity: Minor
Found in phpsysinfo/includes/os/class.SunOS.inc.php - About 7 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 _buildXml has a Cognitive Complexity of 49 (exceeds 5 allowed). Consider refactoring.
Open

    private function _buildXml()
    {
        if (!$this->_plugin_request || $this->_complete_request) {
            if ($this->_sys === null) {
                if (PSI_DEBUG === true) {
Severity: Minor
Found in phpsysinfo/includes/xml/class.XML.inc.php - About 7 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 rfts has a Cognitive Complexity of 49 (exceeds 5 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: Minor
Found in phpsysinfo/includes/class.CommonFunctions.inc.php - About 7 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

File bootstrap-modal.js has 480 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*!
  * Bootstrap modal.js v4.3.1 (https://getbootstrap.com/)
  * Copyright 2011-2019 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
  */
Severity: Minor
Found in phpsysinfo/js/vendor/bootstrap-modal.js - About 7 hrs to fix

    Function processModal has 186 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        function processModal(settings) {
            if (modal.loadingShown || modal.transition || modal.anim)
                return;
            debug('processModal');
            modal.started = true;
    Severity: Major
    Found in phpsysinfo/js/jQuery/jquery.nyroModal.js - About 7 hrs to fix

      Method df has 186 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public static function df($df_param = "", $get_inodes = true)
          {
              $arrResult = array();
              if (CommonFunctions::executeProgram('mount', '', $mount, PSI_DEBUG)) {
                  $mount = preg_split("/\n/", $mount, -1, PREG_SPLIT_NO_EMPTY);
      Severity: Major
      Found in phpsysinfo/includes/class.Parser.inc.php - About 7 hrs to fix

        Function _fnScrollDraw has 185 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                function _fnScrollDraw ( o )
                {
                    var
                        nScrollHeadInner = o.nScrollHead.getElementsByTagName('div')[0],
                        nScrollHeadTable = nScrollHeadInner.getElementsByTagName('table')[0],
        Severity: Major
        Found in phpsysinfo/js/jQuery/jquery.dataTables.js - About 7 hrs to fix

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

          <?php
          /* 25 October 2011. version 1.1-FF4
           *
           * This is the php version of the Dean Edwards JavaScript's Packer,
           * Based on :
          Severity: Minor
          Found in phpsysinfo/includes/js/class.JavaScriptPacker.inc.php - About 7 hrs to fix

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

                private function _network()
                {
                    CommonFunctions::executeProgram('netstat', '-nbdi | cut -c1-25,44- | grep "^[a-z]*[0-9][ \t].*Link"', $netstat_b);
                    CommonFunctions::executeProgram('netstat', '-ndi | cut -c1-25,44- | grep "^[a-z]*[0-9][ \t].*Link"', $netstat_n);
                    $lines_b = preg_split("/\n/", $netstat_b, -1, PREG_SPLIT_NO_EMPTY);
            Severity: Minor
            Found in phpsysinfo/includes/os/class.NetBSD.inc.php - About 7 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 _network has a Cognitive Complexity of 47 (exceeds 5 allowed). Consider refactoring.
            Open

                private function _network()
                {
                    CommonFunctions::executeProgram('netstat', '-nbdi | cut -c1-25,44- | grep Link | grep -v \'* \'', $netstat_b, PSI_DEBUG);
                    CommonFunctions::executeProgram('netstat', '-ndi | cut -c1-25,44- | grep Link | grep -v \'* \'', $netstat_n, PSI_DEBUG);
                    $lines_b = preg_split("/\n/", $netstat_b, -1, PREG_SPLIT_NO_EMPTY);
            Severity: Minor
            Found in phpsysinfo/includes/os/class.OpenBSD.inc.php - About 7 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 __construct has a Cognitive Complexity of 47 (exceeds 5 allowed). Consider refactoring.
            Open

                public function __construct($enc)
                {
                    parent::__construct(__CLASS__, $enc);
                    if (defined('PSI_PLUGIN_PSSTATUS_PROCESSES') && is_string(PSI_PLUGIN_PSSTATUS_PROCESSES)) {
                        switch (strtolower(PSI_PLUGIN_PSSTATUS_ACCESS)) {
            Severity: Minor
            Found in phpsysinfo/plugins/psstatus/class.psstatus.inc.php - About 7 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 renderPlugin_snmppinfo has a Cognitive Complexity of 46 (exceeds 5 allowed). Consider refactoring.
            Open

            function renderPlugin_snmppinfo(data) {
            
                var directives = {
                    Device: {
                        text: function () {
            Severity: Minor
            Found in phpsysinfo/plugins/snmppinfo/js/snmppinfo_bootstrap.js - About 7 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 _network has a Cognitive Complexity of 46 (exceeds 5 allowed). Consider refactoring.
            Open

                private function _network()
                {
                    if (CommonFunctions::executeProgram('ifconfig', '', $bufr, PSI_DEBUG)) {
                        $lines = preg_split("/\n/", $bufr, -1, PREG_SPLIT_NO_EMPTY);
                        $was = false;
            Severity: Minor
            Found in phpsysinfo/includes/os/class.Haiku.inc.php - About 7 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 classSettings has 177 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    function classSettings ()
                    {
                        this.fnRecordsTotal = function ()
                        {
                            if ( this.oFeatures.bServerSide ) {
            Severity: Major
            Found in phpsysinfo/js/jQuery/jquery.dataTables.js - About 7 hrs to fix

              Method execute_mdstat has 173 lines of code (exceeds 25 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: Major
              Found in phpsysinfo/plugins/raid/class.raid.inc.php - About 6 hrs to fix

                Function _pci has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring.
                Open

                    private function _pci()
                    {
                        if ($arrResults = Parser::lspci()) {
                            foreach ($arrResults as $dev) {
                                $this->sys->setPciDevices($dev);
                Severity: Minor
                Found in phpsysinfo/includes/os/class.Linux.inc.php - About 6 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 _fnDraw has 169 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        function _fnDraw( oSettings )
                        {
                            var i, iLen;
                            var anRows = [];
                            var iRowCount = 0;
                Severity: Major
                Found in phpsysinfo/js/jQuery/jquery.dataTables.js - About 6 hrs to fix

                  Function renderNetwork has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring.
                  Open

                  function renderNetwork(data) {
                      if ((blocks.length <= 0) || ((blocks[0] !== "true") && ($.inArray('network', blocks) < 0))) {
                          $("#block_network").remove();
                          return;
                      }
                  Severity: Minor
                  Found in phpsysinfo/js/phpSysInfo/phpsysinfo_bootstrap.js - About 6 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

                  Severity
                  Category
                  Status
                  Source
                  Language