XoopsModules25x/xoopsinfo

View on GitHub

Showing 1,065 of 16,781 total issues

Method get_mimetypes has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

    function get_mimetypes($limit=20, $start=0, $module=-1, $OtherCriteria=null, $asobject=true) {
Severity: Minor
Found in kernel/mimetypes.php - About 35 mins to fix

    Method executeProgram has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        public static function executeProgram($strProgramname, $strArgs, &$strBuffer, $booErrorRep = true, $timeout = 30)
    Severity: Minor
    Found in phpsysinfo/tools/checkdistro.php - About 35 mins to fix

      Method XoopsMediaUploader has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          function XoopsMediaUploader($uploadDir, $allowedMimeTypes, $maxFileSize=0, $maxWidth=null, $maxHeight=null) {
      Severity: Minor
      Found in class/uploader.php - About 35 mins to fix

        Method XoopsFormSelectMime has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            function XoopsFormSelectMime( $caption, $name, $value=null, $size=1, $multiple=false ) {
        Severity: Minor
        Found in kernel/mimetypes.php - About 35 mins to fix

          Method rfts has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              public static function rfts($strFileName, &$strRet, $intLines = 0, $intBytes = 4096, $booErrorRep = true)
          Severity: Minor
          Found in phpsysinfo/tools/checkdistro.php - About 35 mins to fix

            Method XoopsFormSelectType has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                function XoopsFormSelectType( $caption, $name, $value=null, $size=1, $multiple=false ) {
            Severity: Minor
            Found in kernel/mimetypes.php - About 35 mins to fix

              Function refreshOther has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

              function refreshOther(xml) {
                  if ((blocks.length <= 0) || ((blocks[0] !== "true") && ($.inArray('other', blocks) < 0))) {
                      $("#other").remove();
                      return;
                  }
              Severity: Minor
              Found in phpsysinfo/js/phpSysInfo/phpsysinfo.js - About 35 mins 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 items has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

              function items(data) {
                  if (data !== undefined) {
                      if ((data.length > 0) &&  (data[0] !== undefined) && (data[0]["@attributes"] !== undefined)) {
                          return data;
                      } else if (data["@attributes"] !== undefined ) {
              Severity: Minor
              Found in phpsysinfo/js/phpSysInfo/phpsysinfo_bootstrap.js - About 35 mins 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_pingtest has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

              function renderPlugin_pingtest(data) {
              
                  var directives = {
                      PingTime: {
                          html: function () { 
              Severity: Minor
              Found in phpsysinfo/plugins/pingtest/js/pingtest_bootstrap.js - About 35 mins 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 replaceCSS has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

                  replaceCSS: function (cssText) {
                      if (cssText) {
                          // Replace all properties containing REM units with their pixel equivalents.
                          return cssText.replace(
                              /([\d]+\.[\d]+|\.[\d]+|[\d]+)rem/g, function (fullMatch, groupMatch) {
              Severity: Minor
              Found in phpsysinfo/js/vendor/bootstrap-ie8.js - About 35 mins 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 _analyze has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

                  private function _analyze($script, $regexp, $encode)
                  {
                      // analyse
                      // retreive all words in the script
                      $all = array();
              Severity: Minor
              Found in phpsysinfo/includes/js/class.JavaScriptPacker.inc.php - About 35 mins 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 7 (exceeds 5 allowed). Consider refactoring.
              Open

                  private function _network()
                  {
                      if (CommonFunctions::executeProgram('netstat', '-ni | tail -n +2', $netstat)) {
                          $lines = preg_split("/\n/", $netstat, -1, PREG_SPLIT_NO_EMPTY);
                          foreach ($lines as $line) {
              Severity: Minor
              Found in phpsysinfo/includes/os/class.HPUX.inc.php - About 35 mins 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 lspci has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

                  public static function lspci($debug = PSI_DEBUG)
                  {
                      $arrResults = array();
                      if (CommonFunctions::executeProgram("lspci", "", $strBuf, $debug)) {
                          $arrLines = preg_split("/\n/", $strBuf, -1, PREG_SPLIT_NO_EMPTY);
              Severity: Minor
              Found in phpsysinfo/includes/class.Parser.inc.php - About 35 mins 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 7 (exceeds 5 allowed). Consider refactoring.
              Open

                  private function _memory()
                  {
                      if ($this->_wmi) {
                          $buffer = $this->_get_Win32_OperatingSystem();
                          if ($buffer) {
              Severity: Minor
              Found in phpsysinfo/includes/os/class.WINNT.inc.php - About 35 mins 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 build has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function build()
                  {
                      $this->_distro(); //share getDistribution()
                      if ($this->sys->getDistribution()=="ReactOS") {
                          $this->error->addError("WARN", "The ReactOS version of phpSysInfo is a work in progress, some things currently don't work");
              Severity: Minor
              Found in phpsysinfo/includes/os/class.WINNT.inc.php - About 35 mins 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 _grabioreg has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

                  private function _grabioreg($key)
                  {
                      if (CommonFunctions::executeProgram('ioreg', '-c "'.$key.'"', $s, PSI_DEBUG)) {
                          /* delete newlines */
                          $s = preg_replace("/\s+/", " ", $s);
              Severity: Minor
              Found in phpsysinfo/includes/os/class.Darwin.inc.php - About 35 mins 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 ide has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

                  protected function ide()
                  {
                      foreach ($this->readdmesg() as $line) {
                          if (preg_match('/^(.*): (.*) <(.*)> at (ata[0-9]+\-(.*)) (.*)/', $line, $ar_buf)) {
                              $dev = new HWDevice();
              Severity: Minor
              Found in phpsysinfo/includes/os/class.DragonFly.inc.php - About 35 mins 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 _uptime has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

                  protected function _uptime()
                  {
                      if (CommonFunctions::rfts('/proc/uptime', $buf, 1, 4096, PSI_OS != 'Android')) {
                          $ar_buf = preg_split('/ /', $buf);
                          $this->sys->setUptime(trim($ar_buf[0]));
              Severity: Minor
              Found in phpsysinfo/includes/os/class.Linux.inc.php - About 35 mins 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 _i2c has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

                  protected function _i2c()
                  {
                      $i2cdevices = glob('/sys/bus/i2c/devices/*/name', GLOB_NOSORT);
                      if (is_array($i2cdevices) && (($total = count($i2cdevices)) > 0)) {
                          $buf = "";
              Severity: Minor
              Found in phpsysinfo/includes/os/class.Linux.inc.php - About 35 mins 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 _filesystems has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

                  private function _filesystems()
                  {
                      if (CommonFunctions::executeProgram('df', '-b', $df, PSI_DEBUG)) {
                      $df = preg_split("/\n/", $df, -1, PREG_SPLIT_NO_EMPTY);
                          foreach ($df as $df_line) {
              Severity: Minor
              Found in phpsysinfo/includes/os/class.Haiku.inc.php - About 35 mins 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