XoopsModules25x/xoopsinfo

View on GitHub

Showing 1,065 of 16,781 total issues

Avoid too many return statements within this method.
Open

        return true;
Severity: Major
Found in class/uploader.php - About 30 mins to fix

    Avoid too many return statements within this method.
    Open

            return false;
    Severity: Major
    Found in class/uploader.php - About 30 mins to fix

      Avoid too many return statements within this method.
      Open

                      return false;
      Severity: Major
      Found in phpsecinfo/PhpSecInfo/Test/Test.php - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

                return false;
        Severity: Major
        Found in class/uploader.php - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

                          return 'Invalid Result Code';
          Severity: Major
          Found in phpsecinfo/PhpSecInfo/PhpSecInfo.php - About 30 mins to fix

            Avoid too many return statements within this method.
            Open

                            return 'value-notrun';
            Severity: Major
            Found in phpsecinfo/PhpSecInfo/PhpSecInfo.php - About 30 mins to fix

              Avoid too many return statements within this method.
              Open

                              return false;
              Severity: Major
              Found in phpsecinfo/PhpSecInfo/Test/Test.php - About 30 mins to fix

                Avoid too many return statements within this method.
                Open

                                return $ini_val;
                Severity: Major
                Found in phpsecinfo/PhpSecInfo/Test/Test.php - About 30 mins to fix

                  Avoid too many return statements within this method.
                  Open

                                  return 'value-error';
                  Severity: Major
                  Found in phpsecinfo/PhpSecInfo/PhpSecInfo.php - About 30 mins to fix

                    Avoid too many return statements within this method.
                    Open

                                    return 'Error';
                    Severity: Major
                    Found in phpsecinfo/PhpSecInfo/PhpSecInfo.php - About 30 mins to fix

                      Function round has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                      function round(x, n) {
                          var e = 0, k = "";
                          if (n < 0 || n > 14) {
                              return 0;
                          }
                      Severity: Minor
                      Found in phpsysinfo/js/phpSysInfo/phpsysinfo.js - About 25 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 2 has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                      },{"../lib/lodash.js":7,"./context":3,"./helpers":5}],2:[function(require,module,exports){
                      var Attribute, AttributeFactory, BooleanAttribute, Class, Html, Text, helpers, _,
                        __hasProp = {}.hasOwnProperty,
                        __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
                      
                      
                      Severity: Minor
                      Found in phpsysinfo/js/vendor/transparency.js - About 25 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 raid_buildaction has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                      function raid_buildaction(xml) {
                          var html = "", name = "", time = "", tunit = "", percent = 0;
                          $("Action", xml).each(function mdstatus_getaction(id) {
                              name = $(this).attr("Name");
                              if (parseInt(name, 10) !== -1) {
                      Severity: Minor
                      Found in phpsysinfo/plugins/raid/js/raid.js - About 25 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_docker has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                      function renderPlugin_docker(data) {
                      
                          var directives = {
                              CPUUsage: {
                                  html: function () {
                      Severity: Minor
                      Found in phpsysinfo/plugins/docker/js/docker_bootstrap.js - About 25 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_iptables has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                      function renderPlugin_iptables(data) {
                      
                          var directives = {
                              Rule: {
                                  html: function () {
                      Severity: Minor
                      Found in phpsysinfo/plugins/iptables/js/iptables_bootstrap.js - About 25 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_updatenotifier has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                      function renderPlugin_updatenotifier(data) {
                      
                          var directives = {
                              updateNotifierNbPackages: {
                                  text: function () {
                      Severity: Minor
                      Found in phpsysinfo/plugins/updatenotifier/js/updatenotifier_bootstrap.js - About 25 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 _temperature has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                          private function _temperature()
                          {
                              $temp = null;
                              $temp_max = null;
                              if (!CommonFunctions::rfts('/sys/devices/platform/sunxi-i2c.0/i2c-0/0-0034/temp1_input', $temp, 1, 4096, false)) { // Not Banana Pi
                      Severity: Minor
                      Found in phpsysinfo/includes/mb/class.pitemp.inc.php - About 25 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 _temperature has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                          private function _temperature()
                          {
                              foreach ($this->_lines as $line) {
                                  if (preg_match('/^hw\.sensors\.[0-9]+=[^\s,]+,\s+([^,]+),\s+temp,\s+([0-9\.]+)\s+degC.*$/', $line, $ar_buf)) {
                                      $dev = new SensorDevice();
                      Severity: Minor
                      Found in phpsysinfo/includes/mb/class.hwsensors.inc.php - About 25 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 6 (exceeds 5 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.HPUX.inc.php - About 25 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 getMemPercentApplication has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public function getMemPercentApplication()
                          {
                              if ($this->_memApplication !== null) {
                                  if (($this->_memApplication > 0) && ($this->_memTotal > 0)) {
                                      return round($this->_memApplication / $this->_memTotal * 100);
                      Severity: Minor
                      Found in phpsysinfo/includes/to/class.System.inc.php - About 25 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